Repository navigation
Description
Priority
low. The defect is in test code only.
Components
- app/nullius (backend)
- the standard (ports, kits, relay, runs)
Evidence
app/tests/test_audit_regressions.py, test_sigterm_stops_a_real_memory_process_and_writes_cancelled_results, failed in the backend suite of a CI run on a change that does not touch the standard, and passed when the job ran again:
ERROR: test_sigterm_stops_a_real_memory_process_and_writes_cancelled_results (tests.test_audit_regressions.Regressions.test_sigterm_stops_a_real_memory_process_and_writes_cancelled_results)
File ".../app/tests/test_audit_regressions.py", line 100, in test_sigterm_stops_a_real_memory_process_and_writes_cancelled_results
out, err = process.communicate(timeout=12)
subprocess.TimeoutExpired: Command '[...python3', '-c', "\nfrom nullius.standard import definitions,run,cli\n..."]' timed out after 12 seconds
1906 tests in 112 modules, 59 s: 1 module(s) failed
The test sends SIGTERM to a standard run, then gives the run 12 s to stop its memory process, write a cancelled result.json for each unit and the job's result.json, and exit. A loaded runner can exceed a fixed time. #16 made the wait for the memory process to start load-tolerant (a 60 s deadline); the wait after SIGTERM kept its fixed 12 s.
Reproduction
- Run the backend suite on a loaded machine, for example in a container limited to 1 or 2 CPUs:
python3 app/tests/parallel.py. - Repeat. The test fails with
TimeoutExpiredon some runs.
Expected
The test fails only when a stopped run does not stop its memory process, does not write cancelled results, or does not exit. The load of the machine does not change its result.
Acceptance
- The wait after SIGTERM tolerates a loaded machine, as the wait for the memory process to start does.
- The test still fails when the run ignores SIGTERM, leaves the memory process running, or writes no cancelled results.
- The exit code, cancelled-result and parse checks stay as they are.
Dependencies and related
- Tests: backend tests race with the processes they watch #16, which fixed the wait for the memory process to start in this test.
- Tests: the judge batch overlap test fails on wall time under load #109, the same kind of wall-clock limit in the judge batch test.
Activity
fix(standard): stop a run when SIGTERM reaches a thread other than ma…
test(standard): give a stopped memory run a load-tolerant time to cle…