Skip to content

test: await drained CLI output in shared fixtures - #159

Merged
abruption merged 1 commit into
mainfrom
test/047-cli-capture
Oct 18, 2026
Merged

abruption merged 1 commit into
mainfrom
test/047-cli-capture

Conversation

@abruption

Copy link
Copy Markdown
Owner

Why this follow-up is needed

Sequential documentation/research integration exposed a remaining shared-test-helper race on main f3f85e95ecd4415d97d46265bb6bdc39a9829a99.

In CI run 39115010422, the macOS x64 / Node 24 update JSON test passed the exit-code and stderr assertions, then failed JSON parsing with Unexpected end of JSON input. The log does not retain the captured stdout, so it does not distinguish empty from partial JSON.

The shared runCli helper returned at child exit, which does not establish that stdout/stderr pipes have closed. PR #132 / issue #131 fixed the same contract in another CLI test helper, but this shared helper still used exit. Production CLI code uses process.exitCode and is unchanged here; this is not evidence of a Windows/runtime regression.

Changes

  • Extract the existing test-only capture logic and await close before returning stdout/stderr.
  • Preserve UTF-8 capture, code/signal fields and rejection of the original child spawn error.
  • Add a deterministic fake-child regression: emit exit, allow an event-loop turn, assert collection is still pending, then provide late stdout/stderr and close. Also cover signal termination and spawn failure.
  • Do not weaken JSON assertions, extend time budgets, skip tests or change production, dependencies, package contents or release operations.

Validation

  • npm ci, npm run check, npm run lint, npm test, npm run smoke:package, git diff --check.
  • Full local suite: 269 tests, 266 passed, three Linux-only skips, zero failures.
  • Targeted new collector tests: 3/3; relevant update/advisory/cache tests: 3/3.
  • Original failing main run is preserved, not rerun or hidden. No new production claim or native Codex/Windows measurement is made.

This is a test-only integration repair before the remaining user-authorized research merges and v0.4.7 preparation. Merge only after this PR's normal required CI and current-head Code/Security reviews pass; no protection bypass. The failed base CI is the defect being repaired, not a reason to waive this PR's gates. No tag, release or package publication is requested.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T09:34:59.449216Z 68a5e46 PR opened
🔒 Security Review ✅ Completed 2026-10-18T09:35:29.131022Z 68a5e46 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@abruption
abruption merged commit 0d56889 into main Oct 18, 2026
40 checks passed
@abruption
abruption deleted the test/047-cli-capture branch October 18, 2026 09:38
@abruption abruption added this to the v0.4.7 milestone Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant