Skip to content

Commit 40749af

Browse files
sararobcopybara-github
authored andcommitted
chore: fix tensorboard cleanup in system tests
PiperOrigin-RevId: 510180069
1 parent ef350be commit 40749af

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

tests/system/aiplatform/e2e_base.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def tear_down_resources(self, shared_state: Dict[str, Any]):
179179
key=lambda r: 1
180180
if isinstance(r, aiplatform.Endpoint)
181181
or isinstance(r, aiplatform.MatchingEngineIndexEndpoint)
182+
or isinstance(r, aiplatform.Experiment)
182183
else 2
183184
)
184185

@@ -201,12 +202,3 @@ def tear_down_resources(self, shared_state: Dict[str, Any]):
201202
resource.delete()
202203
except exceptions.GoogleAPIError as e:
203204
logging.error(f"Could not delete resource: {resource} due to: {e}")
204-
205-
# When an Experiment has a backing_tensorboard, the Experiment needs to be deleted first
206-
# This is used by the autologging tests
207-
if "tensorboard" in shared_state:
208-
for resource in shared_state["tensorboard"]:
209-
try:
210-
resource.delete()
211-
except exceptions.GoogleAPIError as e:
212-
logging.error(f"Could not delete resource: {resource} due to: {e}")

tests/system/aiplatform/test_autologging.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ def test_autologging_with_autorun_creation(self, shared_state):
152152
experiment_tensorboard=self._backing_tensorboard,
153153
)
154154

155-
shared_state["tensorboard"] = [self._backing_tensorboard]
155+
shared_state["resources"] = [self._backing_tensorboard]
156156

157-
shared_state["resources"] = [
157+
shared_state["resources"].append(
158158
aiplatform.metadata.metadata._experiment_tracker.experiment
159-
]
159+
)
160160

161161
aiplatform.autolog()
162162

0 commit comments

Comments
 (0)