Skip to content

Commit b289fcf

Browse files
sararobcopybara-github
authored andcommitted
chore: fix resource deletion in matching engine test
PiperOrigin-RevId: 525147457
1 parent d75322c commit b289fcf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/system/aiplatform/test_matching_engine_index.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,16 @@ def test_create_get_list_matching_engine_index(self, shared_state):
347347
# )
348348
# assert results[0][0].id == 9999
349349

350-
# Undeploy index
350+
# Undeploy index from private endpoint
351351
my_index_endpoint = my_index_endpoint.undeploy_index(
352352
deployed_index_id=deployed_index.id
353353
)
354354

355+
# Undeploy index from public endpoint
356+
public_index_endpoint = public_index_endpoint.undeploy_index(
357+
deployed_index_id=deployed_index_public.id
358+
)
359+
355360
# Delete index and check that it is no longer listed
356361
index.delete()
357362
list_indexes = aiplatform.MatchingEngineIndex.list()
@@ -365,3 +370,10 @@ def test_create_get_list_matching_engine_index(self, shared_state):
365370
index_endpoint.resource_name
366371
for index_endpoint in aiplatform.MatchingEngineIndexEndpoint.list()
367372
]
373+
374+
# Delete public index endpoint
375+
public_index_endpoint.delete()
376+
assert public_index_endpoint.resource_name not in [
377+
index_endpoint.resource_name
378+
for index_endpoint in aiplatform.MatchingEngineIndexEndpoint.list()
379+
]

0 commit comments

Comments
 (0)