Repository navigation
test(codex-processes): read a fixture's whole READY line, not the first chunk of it - #2383
Merged
Merged
Conversation
…st chunk of it The Codex process fixtures (a node stand-in, a Python lock holder, cat) announce they are up with "READY\n", and the tests took the first read of their stdout for that line. A busy pipe can hand over "READY" and its newline in two reads: then the first read was "READY" and the tests waiting on that handshake failed (two of them in a local bun run check fast at about 81% host load, received "READY" for "READY\n"). Read until the newline. Fail-first, with the Python holder writing "READY" and its newline 0.3 s apart (scratch only): the old file failed 3/3 (66 fail lines each), the new one passed 3/3. Plain runs passed 5/5; bun run check fast ok.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Owner
Author
|
Merging b87b968. Test-only: server/codex-processes.test.ts reads each fixture's whole READY line (a busy pipe can deliver READY and its newline in two reads) instead of the first chunk. Diff read by the merge pass; no CodeRabbit review needed. |
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.
Found by the flake-hunt lane: during a local
bun run check fastat about 81% host load,server/codex-processes.test.tsfailed two tests ("weighs another loaded conversation's answer in any layout Codex shows it in..." and "offers nothing while weighing another loaded conversation's words would take too long"), both atholding()'s handshake:expect(...).toBe("READY\n"), received"READY". The file's earlier CI flakes were fixed in #2101.Cause (test flake)
The Codex process fixtures (the node stand-in in
runningCodex(), the Python lock holder inholding(), and thecatholder) say they are up withREADY\n. Each test took the first read of the fixture's stdout for that whole line. Under load, stdout deliveredREADYand its newline in two reads, so the first read wasREADYand the handshake failed. Whether the split comes from the pipe or from Bun's stream reader is not established; the fix does not depend on it.Change
A
firstLine(stdout)helper reads until the newline (or the stream's end, so a fixture that dies fails the same expect instead of hanging) and releases the reader. All three handshakes use it.Proof
READYand its newline 0.3 s apart (scratch only). The old file failed 3/3, with 66 fail lines each, and the new one passed 3/3.bun test server/codex-processes.test.tspassed 5/5 (107 tests).bun run check fastok.Test-only.
Not covered here
The lane brief also names a "codex-processes.test.ts timeout under load" seen in CI. The 417 CI runs from 2026-10-28 03:26Z to 2026-10-29 18:22Z hold no codex-processes failure, so that one is neither reproduced nor claimed fixed by this PR.
Reviews