Repository navigation
fix(verifiers): release fixture roots only after their owners finish - #10491
Conversation
Several real-tool verifiers released a fixture root even when a cleanup that still used it had failed, so a surviving MCP server, session or descendant kept running against a deleted directory and the failure looked like ordinary cleanup. - scripts/lib/verifier-cleanup.mjs: new releaseAfter(dependents, release, retained) task. It attempts every dependent cleanup and releases the resource only if all succeed; otherwise it keeps the resource and reports it with the dependent failures. - verify-signal-recording: the root is released after the MCP client and transport close, and the host-limits read moves before the root is acquired so its failure cannot leak the root. - verify-recorded-crash: sessions, the sentinel and the process-lineage check must all succeed before the root is released. A transport close failure after a failed connect keeps the connect failure. - verify-wasm-artifact: both roots are released after the MCP client and transport close; the residue check and the two directories stay independent after that. - verify-native-ui: `open -W` exits only after the app exits, so the root is removed only once that exit is observed; otherwise it is retained and reported. Fixes #8561 Fixes #8562 Fixes #8564 Refs #8559 Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ❌ FailedThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable issue remains from this review. SummaryAdds
Both unnumbered previous findings are fixed: signaled launcher exit no longer permits deletion, and the grace timer is cleared after the wait settles. No new actionable issue or rule violation was found. N0zoM1z0 explicitly deferred fixture identity before the ready handshake because a real macOS LaunchServices run was unavailable. This remains outside the stated scope. This review checked source only; it did not run tests or real-tool lanes. Whether another PR supersedes this one could not be checked because GitHub access was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Attempt every dependent cleanup] --> B{All succeeded?}
B -->|Yes| C[Release fixture root]
B -->|No| D[Keep fixture root]
D --> E[Report dependent failures and retained path]
Reviews (4) · Last reviewed commit: "test(verifiers): model open -W exiting a..." · Reviewed by Greptile |
A terminated `open` launcher does not prove the LaunchServices app it started has exited, so only an `open -W` that exits on its own counts. Also clear the grace timer so a prompt exit does not hold the process for the rest of the grace period. Refs #8559 Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The native UI verifier now removes its root only after `open -W` exits on its own. The authored recording's `open` never exited when the fixture was signaled and had no signalCode, so the complete case waited out the grace period and kept the root. The double now behaves like `open -W`: it exits once the fixture process is signaled. Refs #8559 Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
gensokyo-dev
left a comment
There was a problem hiding this comment.
Reviewed the final diff, CI and automated review; approving.
… app Since #10491 the native UI verifier removes its fixture root only after `open -W` exits on its own, which real `open -W` does once the app exits. The macOS lane's launcher stand-in instead stayed alive until the test released it, so every lane case kept its root and failed. The stand-in now exits when the fixture it started exits. Refs #8559 Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Several real-tool verifiers released their fixture root even when a cleanup that still used it had failed. A surviving MCP server, core session, sentinel or GUI fixture then kept running against a deleted directory, and the run reported an ordinary cleanup failure. This fixes the ordering once in the shared helper and applies it to each affected verifier.
Fixes #8561
Fixes #8562
Fixes #8564
Refs #8559
Change and scope
scripts/lib/verifier-cleanup.mjs: newreleaseAfter(dependents, release, retained)cleanup task. It attempts every dependent cleanup and releases the resource only when all of them succeed. Otherwise it keeps the resource and reports it with the dependent failures. Independent cleanups keep usingcloseVerifierResourcesandwithVerifierCleanupunchanged.verify-signal-recording.mjs([Bug] Signal verifier can release its fixture root before MCP cleanup completes #8561): the root is released after the MCP client and transport close. The/proc/self/limitsread moves before the root is acquired, so its failure cannot leak the root.verify-recorded-crash.mjs([Bug] Recorded-crash verifier can release fixtures after cleanup failures #8562): sessions, the sentinel and the process-lineage check must all succeed before the root is released. Before, lineage ran after the root was already gone.verify/recorded-crash/public.mjs: a transport close failure after a failed connect no longer hides the connect failure.verify-wasm-artifact.mjs([Bug] WABT artifact verifier releases both roots after MCP cleanup fails #8564): both roots are released only after the MCP client and transport close. After that, the residue check and the two directories stay independent owners, as the old comment intended.verify-native-ui.mjs([Bug] Native UI verifier can lose fixture ownership before the ready handshake #8559, partial):open -Wexits only when the app exits, so the root is removed only after that exit is observed. Otherwise the root is kept and reported. Not included: establishing the fixture's identity before the ready handshake (the run-token idea from closed fix(native): keep UI fixture ownership through a missing handshake #8646). That needs a real macOS LaunchServices run, which is not available here, so [Bug] Native UI verifier can lose fixture ownership before the ready handshake #8559 stays open.The contributor PRs #8705, #8706 (abhisheksharma001) and #8698 (wunianze666-netizen) each patched one script, and they identified these orderings. This PR fixes the shared rule instead, as the review recommended, and supersedes them.
Contribution scope: verifier scripts only; no product behavior change.
Evidence and regression coverage
tests/boundary/filesystem/verifierCleanup.test.ts(new): the root is released after the dependents succeed; when a dependent fails, the later dependents are still attempted, the root is not released, and both the dependent failure and the retention are reported.node --checkand linted. Real-tool verification is outstanding.Validation performed
npm run test:focused -- tests/boundary/filesystem/verifierCleanup.test.ts: 2 passed.node --checkon the five changed scripts: passed.npm run check:fast(pre-push): passed.Compatibility, safety, and release
Author readiness
Human owner: N0zoM1z0 (PR author, exempt from the declaration per CONTRIBUTING.md).