a wedged test file is ended by a clock its own timers cannot starve (martha#57) #84
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hygiea/57-wedged-run-wall-clock"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (method): a test or mutation run that loops over an adapter call cannot hang for hours while
--test-timeoutand--test-force-exitboth promise it cannot (macula-io/martha#57, Refs macula-io/martha#48).What changed
--test-timeoutis a timer in the test file's own process. A loop that awaits a promise whose body isspawnSyncyields only microtasks, the event loop never turns, the timer never fires, and the run waits for something outside to kill it — a mutant on #48 left one for 2h19m.prove_the_core/a_test_run_ends/end_a_file_whose_own_timers_cannot.tsarms a wall clock in a Worker thread, which has an event loop of its own, so a spinning main thread cannot starve it. At 20 minutes it writes one line naming the file and sends the process SIGKILL. A run that cannot arm the clock is failed by name rather than let through unbounded.fail_a_test_file_that_leaves_something_running.ts) arms it before it takes the leftovers snapshot, so the clock is there from before the file's own code runs. A worker does not appear ingetActiveResourcesInfo(), so it is never counted as something a file left running.a_test_that_spins_its_own_timers_out.tsis the fixture (never run by the suite's globs);a_wedged_file_is_ended_by_a_clock_it_cannot_starve.node-test.tsruns it through the shipped flags and holds the run to ending, named.No new check: the clock rides the guard, and
every_run_of_the_tests_is_boundedalready requires the guard in every shipped run.Proof (msi00,
node:24-trixieat the digest ci.yml pins)--test-timeout=60000 --test-force-exitalone was still spinning at 25 s (killed from outside, rc 137).✖on the file, with… passed the 2000 ms wall clock while its own timers could not fire; its process is killed so the run ends (martha#57).npm run typecheck,npm run lint: green on the same image.mainin the same container (30 there; all permission- or signal-shaped, because the container runs as uid 0, plus the#528red already filed as macula-io/martha#73). No failure is new;#723and#753are green once the single-file run's copy list includes the clock module.ci.yml23 jobs green (structural floor, links, names, import cycle, the three drift checks, base tests, pictures, installer, …), with the clean-install proof and recorded-host relay jobs still running when this was written.Found on the way and filed, not fixed here: macula-io/martha#82 —
npm test's installer stage reads ci.yml's block-scalar checkout step as|and fails on main too.Refs macula-io/martha#57.
Overlap check before landing at
8c26999c(Terra). Merge basea1dab83e, mainc07c0650.PR 84 files (
git diff --name-only a1dab83e 8c26999c, 6):main since base (
git diff --name-only a1dab83e c07c0650, 30), kept at ~/.claude/sessions/terra-logs-0823/main-since-84.txt.comm -12output: (empty). No overlap. It lands --no-ff once all 32 jobs onc07c0650have ended.Landed --no-ff at
caab7f52(parentsc07c0650main,8c26999cPR head) by Terra. Before the push all 32 jobs onc07c0650had ended; gate coverage 5818 was the #98 flake (run 2 only) and nothing private 5837 the baseline. The offline nothing-private check on c07c0650..caab7f52: 437 tree hits, identical to the baseline, 0 commit hits. Main read back =caab7f52.