diff --git a/tests/gateway/test_pending_drain_no_recursion.py b/tests/gateway/test_pending_drain_no_recursion.py index a406c9d602..acedc6ae4b 100644 --- a/tests/gateway/test_pending_drain_no_recursion.py +++ b/tests/gateway/test_pending_drain_no_recursion.py @@ -112,7 +112,9 @@ async def test_in_band_drain_does_not_grow_stack(): # Drain the chain. Each turn schedules the next via the in-band # drain block, so we wait until N handler runs have completed and # the session has been released. - for _ in range(400): + # 2000 * 0.01s = 20s budget: the old 4s budget flaked on loaded CI + # runners (11/12 turns completed; main run 33455779041). + for _ in range(2000): if len(depths) >= N and sk not in adapter._active_sessions: break await asyncio.sleep(0.01) @@ -278,7 +280,9 @@ async def test_late_arrival_drain_still_fires_when_no_in_band_drain(): await adapter.handle_message(_make_event(text="first")) # Wait for the late-arrival drain task to finish the second event. - for _ in range(400): + # 2000 * 0.01s = 20s budget: the old 4s budget flaked on loaded CI + # runners (11/12 turns completed; main run 33455779041). + for _ in range(2000): if "late" in results and sk not in adapter._active_sessions: break await asyncio.sleep(0.01)