From 4ef10b1997a623116998567d2486a26973e4b8b7 Mon Sep 17 00:00:00 2001 From: mandarwagh9 Date: Wed, 29 Jul 2026 22:06:25 +0530 Subject: [PATCH] h2origin autest: honor the 30s squid.log wait budget The hand-rolled watcher relied on StartBefore's default 10 second readiness gate, so the intended 30 second budget was never reached and the test failed intermittently on loaded CI workers. Use the existing AddAwaitFileContainsTestRun helper, which allows 30 seconds, and flush log buffers every second so the entry appears sooner. Fixes: #13445 Co-Authored-By: Claude Opus 5 (1M context) --- tests/gold_tests/h2/h2origin.test.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/gold_tests/h2/h2origin.test.py b/tests/gold_tests/h2/h2origin.test.py index 6b0211a8d00..d5655610edc 100644 --- a/tests/gold_tests/h2/h2origin.test.py +++ b/tests/gold_tests/h2/h2origin.test.py @@ -47,6 +47,9 @@ 'proxy.config.http.server_session_sharing.pool': 'thread', 'proxy.config.http.server_session_sharing.match': 'ip,sni,cert', 'proxy.config.ssl.client.verify.server.policy': 'PERMISSIVE', + # Flush log buffers promptly so that the squid.log entry for the last + # transaction appears while the test is still waiting for it. + 'proxy.config.log.max_secs_per_buffer': 1, }) ts.Disk.remap_config.AddLines( @@ -85,18 +88,9 @@ tr.Processes.Default.StartBefore(server_expect) tr.Processes.Default.ReturnCode = 0 -tr = Test.AddTestRun("Wait for the squid.log to be written") -timeout = 30 -watcher = tr.Processes.Process("watcher") -watcher.Command = f"sleep {timeout}" -watcher.Ready = When.FileContains(ts.Disk.squid_log.Name, r'14 http/1.1 http/2') -watcher.TimeOut = timeout +tr = Test.AddAwaitFileContainsTestRun("Wait for the squid.log to be written", ts.Disk.squid_log.Name, r'14 http/1.1 http/2') tr.StillRunningAfter = ts tr.StillRunningAfter = server -tr.TimeOut = timeout -tr.Processes.Default.StartBefore(watcher) -tr.Processes.Default.Command = 'echo await_squid_log' -tr.Processes.Default.ReturnCode = 0 # UUIDs 1-4 should be http/1.1 clients and H2 origin # UUIDs 5-9 should be http/2 clients and H2 origins