From 068acd6746ee83fedf7b3cceef31c0f9afc8dfbd Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Thu, 18 Jun 2026 16:34:46 +0200 Subject: [PATCH] test: raise default poll_until_condition timeout to deflake integration tests --- tests/_utils.py | 2 +- tests/integration/test_request_queue.py | 2 +- tests/integration/test_run.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/_utils.py b/tests/_utils.py index e17c21ae..4922dae3 100644 --- a/tests/_utils.py +++ b/tests/_utils.py @@ -134,7 +134,7 @@ async def poll_until_condition( fn: Callable[[], Awaitable[T] | T], condition: Callable[[T], bool] = bool, *, - timeout: float = 5, + timeout: float = 30, poll_interval: float = 1, backoff_factor: float = 1, ) -> T: diff --git a/tests/integration/test_request_queue.py b/tests/integration/test_request_queue.py index 4ad0105f..c09e2d7d 100644 --- a/tests/integration/test_request_queue.py +++ b/tests/integration/test_request_queue.py @@ -526,7 +526,7 @@ async def all_locks_visible() -> bool: assert isinstance(head, RequestQueueHead) return locked_ids.isdisjoint(item.id for item in head.items) - await poll_until_condition(all_locks_visible, timeout=30, poll_interval=1) + await poll_until_condition(all_locks_visible) # Unlock all requests unlock_response = await maybe_await(rq_client.unlock_requests()) diff --git a/tests/integration/test_run.py b/tests/integration/test_run.py index 5a3ecfac..811c5794 100644 --- a/tests/integration/test_run.py +++ b/tests/integration/test_run.py @@ -295,7 +295,7 @@ async def get_run() -> Run | None: return await maybe_await(run_client.get()) await poll_until_condition( - get_run, lambda run: isinstance(run, Run) and run.status != 'READY', timeout=30, backoff_factor=2 + get_run, lambda run: isinstance(run, Run) and run.status != 'READY', backoff_factor=2 ) # Metamorph the run into the same actor (allowed) with new input @@ -339,7 +339,7 @@ async def get_run() -> Run | None: return await maybe_await(run_client.get()) current_run = await poll_until_condition( - get_run, lambda run: isinstance(run, Run) and run.status != 'READY', timeout=30, backoff_factor=2 + get_run, lambda run: isinstance(run, Run) and run.status != 'READY', backoff_factor=2 ) # Only try to reboot if the run is still running