Repository navigation
test(agent-tools): let the failing bash child flush its output - #589
Merged
Merged
Conversation
process.exit() drops stdout still queued on a POSIX pipe, so the 400-row assertion failed intermittently on Linux runners. Setting process.exitCode keeps the non-zero exit and lets Node flush before exiting.
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
keeps the status line after the whole output of a failing commandfailed intermittently on Linux runners, in both Source verification and Node compatibility.process.exit(3)right after 400console.logcalls. Node writes to POSIX pipes asynchronously andprocess.exit()does not wait for them, so queued stdout was dropped before the test could read it.process.exitCode = 3. It still exits non-zero and Node flushes stdout first. All assertions are unchanged.Evidence
Reproduced in a Linux container (arm64, Node 22):
process.exit(3)process.exitCode = 3process.exit(3)process.stdout.writableLengthThis is a test-only change. The bash tool's output read-back was not the cause: it receives everything the child actually wrote.
Port status
packages/agent-toolsis shared source. The same one-line test change needs to be ported upstream; it has not been ported yet.Verification
pnpm verifypasses on this commit on macOS (17 gates).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.