The martha#70 setsid-loop test reads the loop's liveness after a fixed wait, so it goes red when the kill lands late under load #222

Closed
opened 2026-11-26 02:51:12 +00:00 by mercurius · 4 comments
Member

Purpose (defect): the test "a process a run started in a session of its own ends with the run, and its root goes after it (martha#70)" is red only when the product is wrong, never because the kill landed after a fixed wait.

Instance: martha-ai/martha#202, PR 211, run 5102 attempt 1, job "gate coverage", task 17025 on host00-martha-bwrap (2026-11-26 02:21→02:38Z). prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.node-test.ts:340, strictEqual at :348: "the loop 75956 the run left in a session of its own outlived the run" (true !== false). The same commit passed the case in pass 1 (5499/0), and the PR doesn't touch this file. Mars ruled it a test race: the check runs before the kill lands.

Shape: after the run exits, the test waits a fixed WAIT_MS and then asserts isRunning(loop) === false once. On a loaded host the teardown's kill, or its reaping, comes after that window.

Done when: the test waits, bounded, until the loop is gone (polling isRunning up to a limit well above the teardown's grace), and is red only if the loop outlives that limit. A mutant that drops the kill still turns it red.

Refs #186 (red only in a full-suite run), #220 (same kill site, a different defect).

Purpose (defect): the test "a process a run started in a session of its own ends with the run, and its root goes after it (martha#70)" is red only when the product is wrong, never because the kill landed after a fixed wait. Instance: martha-ai/martha#202, PR 211, run 5102 attempt 1, job "gate coverage", task 17025 on host00-martha-bwrap (2026-11-26 02:21→02:38Z). `prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.node-test.ts:340`, strictEqual at :348: "the loop 75956 the run left in a session of its own outlived the run" (true !== false). The same commit passed the case in pass 1 (5499/0), and the PR doesn't touch this file. Mars ruled it a test race: the check runs before the kill lands. Shape: after the run exits, the test waits a fixed `WAIT_MS` and then asserts `isRunning(loop) === false` once. On a loaded host the teardown's kill, or its reaping, comes after that window. Done when: the test waits, bounded, until the loop is gone (polling `isRunning` up to a limit well above the teardown's grace), and is red only if the loop outlives that limit. A mutant that drops the kill still turns it red. Refs #186 (red only in a full-suite run), #220 (same kill site, a different defect).
Member

Instance 2, the forge: run 5538, job "gate coverage", task 18467, tip 182179bf (the first fix), 2026-11-26 08:17Z — the case was still red at :476, "the loop 11562 the run left in a session of its own outlived the run" (true !== false), after 5364 ms, i.e. after the whole five-second bound. Five seconds was therefore not "well above" on a full-suite forge run; the kill or its reaping was still in flight.

The bound is now TEAR_DOWN_DEADLINE_MS, read from RUN_DEADLINE_MS (30 s) — the same deadline a wrapped command gets before the check calls it hung — with the assertion unchanged (38034e08). A process the host has not finished ending is not one the run left behind.

Local on 38034e08: the file 14/14 through run_the_tests_in_a_namespace_of_their_own.sh (nice -n 10); with the wrapper's tear-down kill dropped, red after 30685 ms.

Instance 2, the forge: run 5538, job "gate coverage", task 18467, tip 182179bf (the first fix), 2026-11-26 08:17Z — the case was still red at `:476`, "the loop 11562 the run left in a session of its own outlived the run" (true !== false), after 5364 ms, i.e. after the whole five-second bound. Five seconds was therefore not "well above" on a full-suite forge run; the kill or its reaping was still in flight. The bound is now `TEAR_DOWN_DEADLINE_MS`, read from `RUN_DEADLINE_MS` (30 s) — the same deadline a wrapped command gets before the check calls it hung — with the assertion unchanged (38034e08). A process the host has not finished ending is not one the run left behind. Local on 38034e08: the file 14/14 through `run_the_tests_in_a_namespace_of_their_own.sh` (`nice -n 10`); with the wrapper's tear-down kill dropped, red after 30685 ms.
Member

Attempt 1 (flake rule, ruled by Mars): martha main 749a9551 (the PR 253 land), run 5660, job 24229 "gate coverage" red.

  • Test: "a process a run started in a session of its own ends with the run, and its root goes after it (martha#70)", prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.node-test.ts:477, assertion at :485: "the loop the run left in a session of its own outlived the run" (true !== false), 30354 ms.
  • 1 fail of 5591; nothing else red. The #248 hard-killed-loop test passed in the same job.
  • The bounded wait PR 249 added (landed in 3d2eb0b2) lost under full-suite load.

Next: one rerun of 24229 alone. If it is red again, there are no more reruns, and gate coverage stays a known red under this issue until the fix lands.

Attempt 1 (flake rule, ruled by Mars): martha main 749a9551 (the PR 253 land), run 5660, job 24229 "gate coverage" red. - Test: "a process a run started in a session of its own ends with the run, and its root goes after it (martha#70)", prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.node-test.ts:477, assertion at :485: "the loop <pid> the run left in a session of its own outlived the run" (true !== false), 30354 ms. - 1 fail of 5591; nothing else red. The #248 hard-killed-loop test passed in the same job. - The bounded wait PR 249 added (landed in 3d2eb0b2) lost under full-suite load. Next: one rerun of 24229 alone. If it is red again, there are no more reruns, and gate coverage stays a known red under this issue until the fix lands.
Member

Seen again (Terra, lander): martha-ai/martha main ee374a16, landing run 5936 suite.yml, job 25019 "gate coverage" attempt 2 (2026-11-30, rerun once for an unrelated runner-deadline stall noted on #57). The martha#70 test at prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.node-test.ts:535 went red at 16:53:11Z after 60.4s: the loop 11898 (state S) the run left in a session of its own outlived the run. The same test passed twice in attempt 1. No further rerun without Mars.

Seen again (Terra, lander): martha-ai/martha main ee374a16, landing run 5936 suite.yml, job 25019 "gate coverage" attempt 2 (2026-11-30, rerun once for an unrelated runner-deadline stall noted on #57). The martha#70 test at prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.node-test.ts:535 went red at 16:53:11Z after 60.4s: `the loop 11898 (state S) the run left in a session of its own outlived the run`. The same test passed twice in attempt 1. No further rerun without Mars.
Member

Done-when check against main ecb6f372 (landed-but-open sweep, 2026-12-01; closed under the Supervisor ruling of 2026-12-01, which Raf approved). Every commit cited is an ancestor of main (git merge-base --is-ancestor).

  • L1: met, PR 274 and PR 249 (61ec8da0, 3d2eb0b2), keep_a_test_run_in_one_temporary_root.node-test.ts.
  • L2 (the mutants go red): not re-run. Covered by the r=3 review (Vesta to Mars, crew ledger) before PR 274 landed.

Every code line is met. The line the tree cannot show was covered by the review PASS that landed it. Closing.

Done-when check against main `ecb6f372` (landed-but-open sweep, 2026-12-01; closed under the Supervisor ruling of 2026-12-01, which Raf approved). Every commit cited is an ancestor of main (`git merge-base --is-ancestor`). - L1: met, PR 274 and PR 249 (`61ec8da0`, `3d2eb0b2`), `keep_a_test_run_in_one_temporary_root.node-test.ts`. - L2 (the mutants go red): not re-run. Covered by the r=3 review (Vesta to Mars, crew ledger) before PR 274 landed. Every code line is met. The line the tree cannot show was covered by the review PASS that landed it. Closing.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha#222
No description provided.