File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
tests/integration/rest_sync/db/control/pod Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 22import random
33import time
44from pinecone import Pinecone , PodSpec , PodIndexEnvironment
5+ from pinecone .exceptions import NotFoundException
56from tests .integration .helpers import generate_index_name , generate_collection_name
67
78
@@ -137,8 +138,13 @@ def attempt_delete_collection(client, collection_name):
137138def attempt_delete_index (client , index_name ):
138139 time_waited = 0
139140 while client .has_index (index_name ) and time_waited < 120 :
140- if client .describe_index (index_name ).delete_protection == "enabled" :
141- client .configure_index (index_name , deletion_protection = "disabled" )
141+ try :
142+ if client .describe_index (index_name ).delete_protection == "enabled" :
143+ client .configure_index (index_name , deletion_protection = "disabled" )
144+ except NotFoundException :
145+ # Index was deleted between has_index check and describe_index call
146+ # Exit the loop since the index no longer exists
147+ break
142148
143149 print (
144150 f"Waiting for index { index_name } to be ready to delete. Waited { time_waited } seconds.."
You can’t perform that action at this time.
0 commit comments