Repository navigation
test: tolerate a slow post-TERM fixture launch confirmation - #8220
lockhartheavyindustries wants to merge 1 commit into
Conversation
reconcile exits 1 when the launch is not confirmed inside its window, and under set -e with its summary discarded that ended the whole suite silently. The PID and claim waits that follow still fail a real non-start, now with the reconcile summary in the message.
[Low impact] The PR appears safe to merge. Reviews (1) · Last reviewed commit: "test: tolerate a slow post-TERM fixture ..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thank you @lockhartheavyindustries — first look at head Contract-class: restore. The fixture already promised to exercise post-TERM reuse; tolerating a late confirmation under load restores that regression without changing product defaults. VISION, rule by rule: one captain (less flake noise) aligns; authority aligns (no new autonomy); scripts own mechanics aligns (PID/claim waits are exact); restart neutral here; delegation/spine aligns (field flake → coverage); fleet-outlives aligns (portable serial); scope aligns (test infra only). Next: the author work is done. The next step is ours: we run the Full suite, and if it's green this can land as a restore. The red Full suite check before then is our label gate, so there's nothing for you to fix there. |
|
Friendly nudge: this still merges cleanly against current main. #8217 (merged 2026-11-08) changed a different fixture in tests/fm-procevent.test.sh; the post-TERM reuse fixture still runs |
Summary
tests/fm-procevent.test.shcould exit silently after 76 passes with nonot okline.In the post-TERM reuse fixture,
pe "$HPOST_TERM" reconcile >/dev/nullran bare underset -e.When the source launch was not confirmed inside the 3-second confirm window, which a loaded Mac easily misses, reconcile returned 1 with its summary discarded, and the whole suite stopped.
Tolerating a late confirmation is safe here because the next line waits for the child PID and the line after waits for the claim, so a fixture that really never starts still fails.
That failure message now carries the captured reconcile summary.
Related: the macOS
setsidfailure at the latertests/fm-procevent.test.shline is not touched here and is fixed by #8217.#8204 is related load-sensitive test timing.
Intent
B, then open the PR.
Context: the choice was between two versions of a fix for tests/fm-procevent.test.sh. A scout (report data/procevent-test-exit1/report.md, also in the vault as "Process-event test exit investigation") found that in the post-TERM reuse fixture loop (around lines 2931-2932) the
pe "$HPOST_TERM" reconcile >/dev/nullcall runs underset -e. When the source launch is not confirmed within the 3-second window (common on a loaded Mac), reconcile returns 1 with its summary discarded, and the whole suite exits silently after 76 passes with no "not ok" line. The scout proved the fixture does start a few seconds later and all four post-TERM checks then pass. Option A only reported the slow start clearly (capture output, fail with the summary). Option B, chosen: also tolerate a slow launch confirmation as long as the fixture does start, because the next line already waits for the child PID and fails if it never appears, so a real launch failure is still caught. The separate setsid portability fix at line ~5162 is NOT part of this task: upstream PR #8217 already carries the identical change.What Changed
tests/fm-procevent.test.sh, the post-TERM reuse fixture no longer runspe "$HPOST_TERM" reconcilebare underset -e. Before this change, a launch confirmation that missed the reconcile window made reconcile exit 1, which ended the whole suite silently with nonot okline. The call now captures reconcile's combined output and ignores its exit status (|| true).🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change touches one test line and matches option B in the stated intent. If reconcile only misses its confirmation window, the suite no longer stops on that exit 1. If the fixture really never starts, the existing PID wait, claim wait and source-launch
pe listcheck still fail it, and the PID-wait failure now includes the reconcile output. The bin/fm-procevent.sh code at lines 1632-1660 shows that a launch reconcile could not confirm keeps running and only raises a per-home check event, which none of the later post-TERM checks read.Testing
I built a disposable harness from the real test file: the shared setup plus the exact post-TERM loop, under the sameset -e. A PATH-prefixedpsshim delays or refuses the detached runner's own pgid self-check, which runs before it claims the source. That forces a launch-confirm miss on demand, so the test does not depend on a loaded Mac. - Normal launch: the new code passes all four post-TERM cases. - Runner delayed 5 seconds: the base-commit code exits 1 with no "not ok" line, which reproduces the bug. The new code passes all four cases. - Runner that never starts: the new code fails with "not ok - the post-TERM reuse fixture did not start: reconciled: ... failed=1". - Direct reconcile: run alone with the same delay, reconcile returns rc=1 with failed=1, and the claim appears a few seconds later. I stopped the full-file run of tests/fm-procevent.test.sh before it finished, at 55 ok and 0 not ok, because the turn had to end. Remote CI owns the full regression run. I deleted the temporary harness files and shim, and the worktree is clean. The only fm-procevent processes still running belong to the operator's real fleet and the outer no-mistakes run, not to this test.Evidence: Old code, delayed launch: silent exit 1, no not-ok line (bug reproduced)
Source: Old code, delayed launch: silent exit 1, no not-ok line (bug reproduced)
Evidence: New code, delayed launch: all 4 post-TERM checks pass
Source: New code, delayed launch: all 4 post-TERM checks pass
Evidence: New code, runner never starts: fails with reconcile summary
Source: New code, runner never starts: fails with reconcile summary
not ok - the post-TERM reuse fixture did not start: reconciled: published=0 started=0 stopped=0 uncertain=0 failed=1 exit=1Evidence: New code, normal launch: 4 passes
Source: New code, normal launch: 4 passes
Evidence: Direct reconcile with delayed runner: rc=1 failed=1, claim appears later
Source: Direct reconcile with delayed runner: rc=1 failed=1, claim appears later
Evidence: ps shim used to delay or refuse the runner pre-claim check
Source: ps shim used to delay or refuse the runner pre-claim check
Evidence: Partial full-file run (stopped by tester, 55 ok / 0 not ok)
Source: Partial full-file run (stopped by tester, 55 ok / 0 not ok)
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/.pt-new-harness.sh(temporary harness, now deleted: lines 1-157 of tests/fm-procevent.test.sh plus the real post-TERM loop, run underset -eu), with no fault injectedPT_SHIM=<shim> PT_MODE=slow PT_DELAY=5 bash tests/.pt-old-harness.sh: the base-commit (65a9a51f) loop with the runner's pgid self-check delayed 5sPT_SHIM=<shim> PT_MODE=slow PT_DELAY=5 bash tests/.pt-new-harness.sh: the same delayed launch against the changed loopPT_SHIM=<shim> PT_MODE=nostart bash tests/.pt-new-harness.sh: the runner refuses its pgid check, so it never claims and never startsDirectbin/fm-procevent.sh registerthenreconcilein a disposable FM_HOME and claim root, with the delayed-runner shim, then a check that the claim appears late, thenretirebash tests/fm-procevent.test.sh: full single-file run, stopped by the tester before it finished (55 ok, 0 not ok at stop time)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.