From d914e2334466d8e71dfa45da43fe7e48c7675ec7 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 4 Nov 2026 23:07:44 -0800 Subject: [PATCH] test(approval): best-of-3 both sizes and floor the bound at 2s Review (Greptile): a fast best-of-3 baseline with a single wide sample could put the bound under the 2s the test guide requires, so a load spike during the one wide run could fail an unchanged linear scan. Both sizes are now best-of-3 and the bound is max(2.0, base*8). --- tests/tools/test_approval_pipe_shell.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/tools/test_approval_pipe_shell.py b/tests/tools/test_approval_pipe_shell.py index 79fa0fbadd..968489ad9c 100644 --- a/tests/tools/test_approval_pipe_shell.py +++ b/tests/tools/test_approval_pipe_shell.py @@ -102,9 +102,14 @@ class TestPipeRemoteToShellPattern: detect_dangerous_command(command) return time.perf_counter() - start - base = min(scan(1000) for _ in range(3)) - wide = scan(4000) - assert wide < base * 8 + 0.5 + def best(n): # drop load spikes: the least-loaded of three samples + return min(scan(n) for _ in range(3)) + + base = best(1000) + wide = best(4000) + # Linear 4x the input stays near 4x the time; quadratic is ~16x. Floor the bound at 2s per the + # test guide so a fast baseline cannot make it tight on a loaded runner. + assert wide < max(2.0, base * 8) def test_or_list_is_not_a_pipe_for_the_widened_sink(self): pipe = "|"