From 1c0380bcd4c390466567e278783f32c148c4c3a6 Mon Sep 17 00:00:00 2001 From: Anonymous78e <123822114+Anonymous78e@users.noreply.github.com> Date: Wed, 25 Nov 2026 23:04:14 +0100 Subject: [PATCH] tests: the parallel timeout case no longer times out its healthy modules on a loaded CPU (TEST-SEMANTIC-TIMEOUT-QUICK-LOAD) test_parallel_timeout_reports_partial_output_and_keeps_healthy_modules ran the whole suite under --timeout 1. The limit applies to every module, so on a loaded CPU the two healthy modules timed out as well and the run reported "3 files, 0 tests, 3 files failed". The run now gets a 10 s limit, which the healthy modules do not reach, while the hanging module sleeps for 60 s and still times out; the subprocess limit of this one call is raised to 60 s to leave room for it. Co-Authored-By: Claude Opus 5.5 --- tests/test_run_semantic_tests.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_run_semantic_tests.py b/tests/test_run_semantic_tests.py index 7fc75e3722..453845ea5f 100644 --- a/tests/test_run_semantic_tests.py +++ b/tests/test_run_semantic_tests.py @@ -58,9 +58,9 @@ def run(*argv): return code, out.getvalue() -def cli(*argv): +def cli(*argv, timeout=15): return subprocess.run([sys.executable, "-I", os.path.join(ROOT, "scripts", "run_semantic_tests.py"), *argv], - capture_output=True, text=True, timeout=15) + capture_output=True, text=True, timeout=timeout) class RunnerTest(unittest.TestCase): @@ -68,11 +68,13 @@ def test_parallel_timeout_reports_partial_output_and_keeps_healthy_modules(self) with tempfile.TemporaryDirectory() as tmp: suite(tmp, {"helper.py": "X = 1\n", "test_hang.py": HANG, "test_pass_one.py": PASS, "test_pass_two.py": PASS}) - result = cli(tmp, "-j", "2", "--timeout", "1") + # The limit applies to every module, so it must be one the two healthy modules cannot reach on a + # loaded CPU (at 1 s they timed out too); the hanging one sleeps for 60 s, so it still times out. + result = cli(tmp, "-j", "2", "--timeout", "10", timeout=60) self.assertEqual(result.returncode, 1, result.stdout + result.stderr) self.assertIn("before-sleep-marker", result.stdout) self.assertIn("==== FAILED: test_hang", result.stdout) - self.assertIn("TIMED OUT after 1 s: test_hang", result.stdout) + self.assertIn("TIMED OUT after 10 s: test_hang", result.stdout) self.assertIn("3 files, 4 tests, 1 files failed", result.stdout) self.assertNotIn("Traceback", result.stdout + result.stderr)