From 065473fdce2438f6dc84385919c4073eaf680ffa Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 23 Jul 2026 09:56:15 -0700 Subject: [PATCH] test(gateway): loosen hygiene-timeout wall-clock bound to flake policy minimum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0.15s missed by 1-8ms on busy CI shards twice today (runs 30025889952, 30026770278 — branches not touching this file). The assertion pins 'handler did not block on the timeout path' (blocking = seconds); 2.0s keeps the contract per the loose-bounds flake policy. --- tests/gateway/test_session_hygiene.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/gateway/test_session_hygiene.py b/tests/gateway/test_session_hygiene.py index d03903747ec67..b41b303784439 100644 --- a/tests/gateway/test_session_hygiene.py +++ b/tests/gateway/test_session_hygiene.py @@ -811,7 +811,11 @@ def _compress_context( elapsed = time.monotonic() - started assert result == "ok" - assert elapsed < 0.15 + # Loose wall-clock bound per flake policy: this asserts the handler did + # NOT block on the hygiene-compression timeout path (which would take + # multiple seconds), not a precise latency. 0.15s missed by ~1-8ms on + # busy CI shards twice on 2026-07-23. + assert elapsed < 2.0 assert worker_started.is_set() assert runner._run_agent.await_count == 1 assert runner._hygiene_compression_failure_cooldowns["sess-timeout"] > time.time()