diff --git a/tests/test_core.py b/tests/test_core.py index bea00a3..aaf2faf 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -256,17 +256,20 @@ def test_spawn_test_ok_still_running(): def test_spawn_test_crashed(): - # A process that exits with a non-zero code immediately + # A process that exits with a non-zero code immediately. + # Timeout is generous (not 0.3s) so a slow CI runner's interpreter startup + # can't outlast it and misclassify the crash as "ok" (still running). See #12. r = c.spawn_test( - {"command": sys.executable, "args": ["-c", "raise SystemExit(1)"]}, timeout=0.3 + {"command": sys.executable, "args": ["-c", "raise SystemExit(1)"]}, timeout=2.0 ) assert r["outcome"] == "crashed" assert r["returncode"] == 1 def test_spawn_test_exited_cleanly(): - # A process that exits 0 before timeout (unusual for a server) - r = c.spawn_test({"command": sys.executable, "args": ["-c", "pass"]}, timeout=0.5) + # A process that exits 0 before timeout (unusual for a server). + # Generous timeout so slow-runner startup can't flip this to "ok". See #12. + r = c.spawn_test({"command": sys.executable, "args": ["-c", "pass"]}, timeout=2.0) assert r["outcome"] == "exited" assert r["returncode"] == 0 @@ -288,7 +291,7 @@ def test_spawn_test_stderr_captured(): "command": sys.executable, "args": ["-c", "import sys; sys.stderr.write('test-err\\n'); sys.exit(2)"], }, - timeout=0.5, + timeout=2.0, ) assert r["outcome"] == "crashed" assert "test-err" in r["stderr"]