fix(tests): watchdog exits with code 2 so run_tests_batched.py sees the timeout
The conftest watchdog (e1c8730f) used os._exit(0) after the 30s sleep. run_tests_batched.py calls subprocess.run(check=True) and only prints 'Batch N failed.' when the subprocess exits non-zero. Exit 0 hid the failure: pytest got killed mid-test, the FAILURES section never printed, and the runner silently moved to the next batch. The 'Total batches with failures: 1' summary at the end was therefore undercounting.
Fix: os._exit(0) -> os._exit(2). Code 2 is the standard 'interrupted by signal/timeout' code; pytest also uses it for Ctrl-C. The batched runner now correctly reports a non-zero exit as a failure.
Test updated (docstring) to document the new contract. 3/3 test_conftest_watchdog.py still pass.
This commit is contained in:
+1
-1
@@ -77,7 +77,7 @@ if not _warmup_app_controller.wait_for_warmup(timeout=60.0):
|
||||
def _watchdog_exit() -> None:
|
||||
import time
|
||||
time.sleep(30.0)
|
||||
os._exit(0)
|
||||
os._exit(2)
|
||||
import threading
|
||||
threading.Thread(target=_watchdog_exit, daemon=True, name="conftest-hang-watchdog").start()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user