From 515722bf4f12a3be675d1c72c10f1b4ffb01a434 Mon Sep 17 00:00:00 2001 From: Donkie Date: Wed, 7 Aug 2024 15:12:42 +0200 Subject: [PATCH] Attempt to make itest spoolman up check more robust --- tests_integration/tests/conftest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests_integration/tests/conftest.py b/tests_integration/tests/conftest.py index e3ba574..d6ad554 100644 --- a/tests_integration/tests/conftest.py +++ b/tests_integration/tests/conftest.py @@ -37,17 +37,19 @@ def get_db_type() -> DbType: return db_type -@pytest.fixture(scope="session", autouse=True) -def _wait_for_server(): # noqa: ANN202 +def pytest_sessionstart(_: pytest.Session) -> None: """Wait for the server to start up.""" start_time = time.time() while True: try: + print("pytest: Waiting for spoolman to be available...") # noqa: T201 response = httpx.get(URL, timeout=1) response.raise_for_status() + print("pytest: Spoolman now seems to be up!") # noqa: T201 except httpx.HTTPError: # noqa: PERF203 if time.time() - start_time > TIMEOUT: raise + time.sleep(0.5) else: break