Skip to content

Commit

Permalink
Add timeout check
Browse files Browse the repository at this point in the history
  • Loading branch information
pritishpai committed Jan 20, 2025
1 parent 7c58407 commit 01d8810
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/integration/install/test_installation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dataclasses
import json
import logging
import time
from datetime import timedelta
from typing import NoReturn

Expand All @@ -19,6 +20,7 @@
AlreadyExists,
InvalidParameterValue,
NotFound,
ResourceDoesNotExist,
)
from databricks.sdk.retries import retried

Expand Down Expand Up @@ -393,8 +395,18 @@ def test_check_inventory_database_exists(ws, installation_ctx):


def test_compare_remote_local_install_versions(ws, installation_ctx):
installation_finished = installation_ctx.workspace_installation.run()
assert installation_finished
installation_ctx.workspace_installation.run()

# max time to wait for the installation to finish
timeout_duration = 5

for _ in range(timeout_duration):
try:
installation_ctx.installation.load(WorkspaceConfig)
break
except ResourceDoesNotExist:
logger.info("Waiting for the installation to finish...")
time.sleep(1)

with pytest.raises(
RuntimeWarning,
Expand Down

0 comments on commit 01d8810

Please sign in to comment.