The #70 loop case waits, bounded, for the loop to end, never reading it once after a fixed wait (martha#222) #274

Manually merged
terra merged 0 commits from vesta/222-loop-outlived-the-bound into main 2026-11-27 01:15:04 +00:00
Member

Purpose (flake class): the "#70 loop in a session of its own" case reds at 30 s under a full suite although the same case runs in ~250-280 ms on a green rerun, so its wait was measuring the tear-down's worst case rather than the loop.

What changed (the test file only, no product code). TEAR_DOWN_DEADLINE_MS = 2 * RUN_DEADLINE_MS (60 s), with the measurement and the reason in the comment: the tear-down runs after the command has ended and may give the command's session two 10 s graces, and a SIGKILLed process under a full suite can sit in uninterruptible sleep. THE_CASES_TIMEOUT_MS = RUN_DEADLINE_MS + TEAR_DOWN_DEADLINE_MS + RUN_DEADLINE_MS is given to the case as its own test(..., { timeout }), above the runner's 60 s, so a process that outlives the wait fails by name instead of being cancelled. The assertion's message now names the process's kernel state (state D / state R / gone from /proc) and what the run said, so the next instance says which candidate it was.

Proof. Its own file through the namespace wrapper on the tip: 14/14 pass, the case at 251 ms. The teeth test (the kill dropped) reds by name. The whole npm test on the merged tip that carries this package: 5610 tests, 5572 pass, 0 fail, 38 skipped, 518 s. .github/workflows is 0 bytes against the post-268 main, and the private check is clean on both ranges.

Nothing else uses untilGone; this is the one case.

Refs #222

Purpose (flake class): the "#70 loop in a session of its own" case reds at 30 s under a full suite although the same case runs in ~250-280 ms on a green rerun, so its wait was measuring the tear-down's worst case rather than the loop. **What changed (the test file only, no product code).** `TEAR_DOWN_DEADLINE_MS = 2 * RUN_DEADLINE_MS` (60 s), with the measurement and the reason in the comment: the tear-down runs after the command has ended and may give the command's session two 10 s graces, and a SIGKILLed process under a full suite can sit in uninterruptible sleep. `THE_CASES_TIMEOUT_MS = RUN_DEADLINE_MS + TEAR_DOWN_DEADLINE_MS + RUN_DEADLINE_MS` is given to the case as its own `test(..., { timeout })`, above the runner's 60 s, so a process that outlives the wait fails by name instead of being cancelled. The assertion's message now names the process's kernel state (`state D` / `state R` / `gone from /proc`) and what the run said, so the next instance says which candidate it was. **Proof.** Its own file through the namespace wrapper on the tip: 14/14 pass, the case at 251 ms. The teeth test (the kill dropped) reds by name. The whole npm test on the merged tip that carries this package: 5610 tests, 5572 pass, 0 fail, 38 skipped, 518 s. `.github/workflows` is 0 bytes against the post-268 main, and the private check is clean on both ranges. Nothing else uses `untilGone`; this is the one case. Refs #222
TEAR_DOWN_DEADLINE_MS was RUN_DEADLINE_MS, the deadline a wrapped command gets before the run is called hung. But
the tear-down runs only after the command has ended, and it may give that session two graces of its own
(THE_COMMANDS_SESSION_ENDS_MS each) before what is left is killed; and a process SIGKILLed under a full suite can sit
in uninterruptible sleep until the kernel lets it go. Job 24229 consumed the whole of the old bound (30354 ms) where
the same case takes 277 ms on a quiet box.

The wait is now twice the command's deadline, and the case carries a timeout above that wait, so a process that
outlives it fails by name instead of being cancelled by the runner. A failed check now names the process's kernel
state and prints what the run said, so the next instance says which of those it was. With the tear-down's kill
dropped, the case reds by name at 60278 ms — and the hard-killed-loop case beside it too.
terra manually merged commit 61ec8da029 into main 2026-11-27 01:15:04 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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!274
No description provided.