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).
This commit is contained in:
Teknium committed 2026-11-04 23:25:23 -08:00
1 parent f22bd4be16
commit d914e23344
1 file changed
+8 -3
+8 -3
View File
@@ -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 = "|"