From 44c362889a1c8f92d20b09da90ee91c35eb8eeb0 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sun, 2 Aug 2026 15:39:43 -0700 Subject: [PATCH] test(agent): deflake progress-extension timing per FLAKY policy (re-review #8) test_progress_extends_idle_budget_until_success raced wall-clock: the 0.1s-idle/0.04s-tick shape left ~60ms of slack per tick, so one slow scheduler pass on a loaded CI box lapsed the idle budget mid-loop. Widened to 0.5s idle / 0.1s ticks (5x per-tick margin, total runtime still <1s) per the FLAKY policy's minimum-margin guidance. --- tests/agent/test_compress_context_progress_timeout.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/agent/test_compress_context_progress_timeout.py b/tests/agent/test_compress_context_progress_timeout.py index 5f7a5eb897487..bd4aec6c7a3ea 100644 --- a/tests/agent/test_compress_context_progress_timeout.py +++ b/tests/agent/test_compress_context_progress_timeout.py @@ -100,8 +100,13 @@ class TestRunCompressContextWithProgressTimeout: def worker(fence: CompressionCommitFence): fence_holder["fence"] = fence # Keep ticking within each idle window so the waiter extends. + # Round-2 #8 (FLAKY policy): the old 0.1s-idle/0.04s-tick shape + # left only ~60ms of slack per tick — one slow scheduler pass on + # a loaded CI box let the idle budget lapse mid-loop. >=0.5s + # idle with 0.1s ticks keeps a 5x margin per tick while the + # total runtime stays under a second. for _ in range(6): - time.sleep(0.04) + time.sleep(0.1) fence.touch_progress() if not fence.begin_commit(): return (original, "aborted") @@ -114,8 +119,8 @@ class TestRunCompressContextWithProgressTimeout: worker=worker, messages=original, system_prompt_fallback="fallback", - idle_timeout_seconds=0.1, - total_ceiling_seconds=1.0, + idle_timeout_seconds=0.5, + total_ceiling_seconds=5.0, ) assert result_msgs == compressed