Repository navigation
test(pipeline): tolerate broken pipes from early child exits - #3832
Merged
Merged
Conversation
The child's exit already closes the pipe's read end, so the 8 MiB write fails with BrokenPipe with or without `exec 0<&-`. Keep only what drives the result. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
KuSh
approved these changes
Oct 2, 2026
KuSh
left a comment
Collaborator
There was a problem hiding this comment.
Round 1 of 3 — APPROVED
Claim: run_with_stdin tolerates BrokenPipe from a child that exits before reading stdin, and a new test pins it (fixes #3739).
Scope: accept.
Ran: wc_preserves_native_failure_exit_code × 2000 per side. Idle: 0 failures on both sides. Under 48 CPU burners, develop fails 929/2000 with BrokenPipe and this PR fails 0/2000. The new test fails 500/500 against the original helper and passes 500/500 on the PR.
Matrix: executed this round.
CI @dddf245b4: all green (10/10).
Blocks merge (0)
Optional
- The redundant
exec 0<&-in the early-exit child is removed in dddf245. The test passed 500/500 without it, because the child's exit already closes the pipe.
Checked and correct
- Clean merge into current develop; fmt, clippy and
pipeline_stdin_testgreen. - Errors other than
BrokenPipestill fail the helper.
Next
fixup dddf245 pushed, code-reviewed: it removes the redundant exec 0<&- — approving.
Rounds: 1/3. Threads: 0 open.
Merged
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
The stdin test helper can race with a child that rejects its arguments and exits before reading stdin. Allow only
BrokenPipefromwrite_all, then collect the child's output and exit status. Other write errors still fail the test.Add a deterministic regression: a child closes stdin and exits with status 7, while the parent writes more than a pipe buffer. The test checks that the helper returns the child's stdout and status rather than panicking.
Fixes #3739.
Test plan
cargo fmt --all --checkcargo clippy --all-targetscargo test --allon Windows, Rust 1.98.0 (MSVC).sh/wc; the early-exit regression fails with the original helper (BrokenPipe) and passes with the fix.The integration file is
cfg(unix), so ordinary Windows Cargo tests skip it. The standalone check removed that gate only in a temporary copy; the committed file keeps its platform boundary. Native Linux/macOS execution remains for CI.