Repository navigation
fix(tests): treat zombies as stopped in process liveness checks (#11819) - #12034
Merged
Merged
Conversation
Fixes morluto#11819. Killed descendants waiting to be reaped read as alive to process.kill(pid, 0), so three boundary tests fail in containers whose PID 1 does not reap orphans. The liveness checks now treat a zombie as stopped, using the existing observePosixProcess helper (ps -o stat=, comm-safe) with two small wrappers, processHasStopped / processGroupHasStopped, swapped in at the three call sites. Test-only change; production code untouched.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
[Low impact] The PR appears safe to merge; no blocking issue was found. SummaryThe PR makes test liveness checks count zombies as stopped without changing production code.
Reviews (3) · Last reviewed commit: "Merge main and verify process-group stop..." · Reviewed by Greptile |
13 tasks
This was referenced Nov 18, 2026
morluto
pushed a commit
that referenced
this pull request
Nov 18, 2026
…12091) Where PID 1 does not reap orphans promptly, a killed descendant stays a zombie for a while. Signal 0 still reaches a zombie, and a raw process table still lists it, so four boundary tests decided a stopped process was alive although cleanup had worked. The stop assertions in artifactVerifierCleanupOwner and desktopBuildOwnedCommand now use processHasStopped. The run-token sweep in ownedCommand reads the product's liveProcesses view, which drops zombie rows. The testing guide says to assert a stop this way and not with signal 0. Ported onto current main from #11837. The helper and the first eight cases landed in #12034, so this keeps the four that remained. Co-authored-by: Dayan Kijege <[email protected]>
1 of 19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11819.
Killed descendants that are waiting to be reaped read as alive to
process.kill(pid, 0), so three boundary tests fail in containerswhose PID 1 does not reap orphans. The liveness checks now treat a
zombie as stopped, using the repo's existing
observePosixProcesshelper (
ps -o stat=, comm-safe) with two small wrappers,processHasStopped/processGroupHasStopped, swapped in at thethree call sites:
desktopTaskReaderRunner(reader liveness),mcpDoctorwaitForExit, andownedGroupCleanup(process-groupliveness). Test-only change; production code untouched.
Tests:
kunaVersionProbeOwnership7/7,desktopTaskReaderRunner22 passed + 1 skipped,
mcpDoctor33 passed — the 8 tests from#11819, run in a non-reaping container where they failed at baseline.
npm run check:fastexit 0. Full typecheck could not run locally(OOM on this machine); CI is the gate.
Caveats, please read before merging:
via the OpenCode ACP adapter) and reworked by Lotus onto the repo
helper for review quality; the diff below is the reworked version,
not her verbatim diff. Her original approach read /proc directly
and had a comm-with-spaces parsing caveat; this version removes it.
result on a normal machine proves no regression only — the
non-reaping-container run above is the real evidence.
Maintainer update
The prior CI run failed formatting in the process observation helper. The review also identified missing process-group coverage. While adding that coverage, I reproduced a second issue. With
psunavailable, the old signal-zero fallback treatedEPERMas proof that a group had stopped.The fallback now treats only
ESRCHas absence and keeps the Windows single-process check on signal zero. The controlledpscases exercise empty, zombie-only, mixed live/zombie, unrelated groups and checker failures. The change remains test-only.On macOS and Node 24.22.1, all 65 focused tests passed across process observation, reader cleanup, MCP doctor and Kuna probe ownership.
npm run check:fastand targeted formatting also passed. The original non-reaping-container observations above were reported by the author and were not repeated for this revision.Author readiness
Human owner: @phon-t