Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: logger for index deletion failures in Azure AI #1240

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions integrations/azure_ai_search/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@

from haystack_integrations.document_stores.azure_ai_search import AzureAISearchDocumentStore

logger = logging.getLogger(__name__)


# This is the approximate time in seconds it takes for the documents to be available in Azure Search index
SLEEP_TIME_IN_SECONDS = 10
MAX_WAIT_TIME_FOR_INDEX_DELETION = 5
MAX_WAIT_TIME_FOR_INDEX_DELETION = 10


@pytest.fixture()
Expand Down Expand Up @@ -75,8 +78,8 @@ def wait_for_index_deletion(client, index_name):
try:
client.delete_index(index_name)
if not wait_for_index_deletion(client, index_name):
logging.error(f"Index {index_name} was not properly deleted.")
logger.error(f"Index {index_name} was not properly deleted.")
except ResourceNotFoundError:
logging.info(f"Index {index_name} was already deleted or not found.")
logger.info(f"Index {index_name} was already deleted or not found.")
except Exception as e:
logging.error(f"Unexpected error when deleting index {index_name}: {e}")
logger.error(f"Unexpected error when deleting index {index_name}: {e}")
Loading