martha#225: every child this file starts is waited for to its end, so a loaded box cannot report it left running #247
Loading…
Reference in a new issue
No description provided.
Delete branch "ceres/225-held-process-leak"
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 (reliability): a full-suite run is not red because of a child process that one test leaves behind.
What was wrong
src/end_a_launch/recorded_inside_the_hold.node-test.tsspawns a member and ended it int.afterwithmember.kill('SIGKILL'). A kill sends a signal; it does not return once the child is gone. The run judges what a file left running after its last hook, and gives the kernel onlySETTLE_TURNSturns of the loop to let a child go (prove_the_core/a_test_run_ends/every_test_file_cleans_up.ts), so on a slower box the child can still be a liveProcessWrapwhen the file ends — which is the red #225 records:left running after its tests: a child process (ProcessWrap). Stop it in t.after., in 211 ms, in the same job where step 14 passed the same file.The change, one file
endThe(member), ends every child this file starts: it registers the exit before the signal and waits for it, so an exit cannot land between the two and be waited for forever, and a child that has already ended is left alone — the ruleend_a_launch.tsfollows for a child that is not running.t.afternow ends its member through it.A_CHILDS_DELAYED_EXIT_MS), asks for its end, and asserts it has ended when the tear-down returns.Proof
npm run test:file -- src/end_a_launch/recorded_inside_the_hold.node-test.ts, inrun_the_tests_in_a_namespace_of_their_own.sh).endThe's wait removed (the old tear-down,member.kill('SIGKILL')and return), 3 runs of 3 fail on the new case withAssertionError: the child had ended by the time the tear-down returned, so the file cannot leave it running. With the wait back, both cases pass.npm run typecheckandnpm run lintclean;check:restated-values,check:no-import-cycle,check:no-launcher-outlives-its-run,check:no-member-outlives-its-runandcheck:every-check-runs-in-a-jobpass on the tip.Refs martha-ai/martha#225, martha-ai/martha#198.
b478e03f' into ceres/225-held-process-leak 00e9070b62