From 0cda648dfb1572e607856054429a099edbab98d8 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 17 Jul 2026 06:20:01 -0700 Subject: [PATCH] test(approval): loosen wall-clock perf bounds 0.15s -> 2.0s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These guard against catastrophic regex backtracking (seconds-to-minutes class), but 0.15s is within scheduler-stall noise on loaded shared CI runners — test_max_accepted_separator_free_input_is_fast failed a CI shard this week on runner load alone. 2.0s still catches the regression class with zero flake surface. --- tests/tools/test_execution_flag_detection.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/tools/test_execution_flag_detection.py b/tests/tools/test_execution_flag_detection.py index da07b54bb48..985af3bde3c 100644 --- a/tests/tools/test_execution_flag_detection.py +++ b/tests/tools/test_execution_flag_detection.py @@ -557,7 +557,11 @@ def test_long_separator_free_token_hits_early_cap_before_regexes(size): "command parser limit exceeded", "command parser limit exceeded", ) - assert elapsed < 0.15, f"{size} byte token took {elapsed:.3f}s" + # Guards against catastrophic regex backtracking (seconds-to-minutes). + # The bound is deliberately loose: on a loaded shared CI runner even a + # trivially-fast call can see 100s of ms of scheduler stall, so a tight + # bound flakes without catching anything extra. + assert elapsed < 2.0, f"{size} byte token took {elapsed:.3f}s" def test_max_accepted_separator_free_input_is_fast(): @@ -569,4 +573,6 @@ def test_max_accepted_separator_free_input_is_fast(): elapsed = time.perf_counter() - started assert result == (False, None, None) - assert elapsed < 0.15, f"max accepted token took {elapsed:.3f}s" + # Loose bound: catches the O(n^2)/backtracking regression class without + # flaking on CI scheduler stalls (see comment above). + assert elapsed < 2.0, f"max accepted token took {elapsed:.3f}s"