Repository navigation
test: remove stdout-drain and fixture-replacement races - #132
Merged
Merged
Conversation
Codex Review SummaryThis 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. |
This was referenced Oct 13, 2026
This was referenced Oct 18, 2026
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.
Summary
CLI contract tests now wait for child
close, so stdout/stderr pipes have drained before JSON parsing. The coordinated replacement fixture prepares a sibling file and atomically renames it over the original, keeping the path present while changing its inode; the separate unlink case is unchanged.This addresses two existing harness races exposed by documentation PRs: #124's malformed-thread-ID test parsed incomplete stdout in run 38350388686, and #125's replacement test observed the fixture's temporary absent path in run 38350521889.
Closes #131
Type
Safety impact
Only the CLI test helper and synthetic writer fixture change. Real advisory locks, existing inode/retry assertions, separate absence coverage, production probing, and production retry budgets are preserved.
Checklist
npm run checkpassesnpm run lintpassesnpm testpassesnpm run smoke:packagepasses when packaging changedNotes
Local validation on macOS arm64, Node 24.16.0:
npm ci, type checking, lint, all 223 tests, package smoke, andgit diff --checkpassed. The affected CLI parsing and coordinated unlink/replace tests also passed 20 consecutive focused runs. Full platform CI remains required; local results do not establish the outcome of reruns on the original macOS x64 runners.once(child, "close")retains rejection on child startup errors. The replacement file is created exclusively in the isolated synthetic fixture directory before an atomic same-directory rename, while the native guard is held. No assertions were weakened and no tests disabled.Current validation
At
9117a7bdac21defdbaaaae2a735734517240743b, all 33 PR checks pass, including the supported macOS/Linux matrix. Current-head Codex Code/Security reviews completed without inline findings. The original documentation PR jobs also passed on one rerun; their first failures remain documented above and in #131.