From 83cde7f31dcf347f07b74eaddf6407646ad56566 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 1 Sep 2026 09:35:00 -0700 Subject: [PATCH] test(gateway): widen pending-drain chain wait budget (4s -> 20s) Same loaded-runner class: the 12-turn drain chain completed only 11 turns inside the 400x0.01s poll budget on main run 33455779041. The loop still exits early on success, so the wider budget costs nothing on healthy runs. --- tests/gateway/test_pending_drain_no_recursion.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)