Skip to content

Commit 099a5dd

Browse files
committed
test: ensure seq test triggers broken pipe with infinite output
Use an infinite sequence in `test_broken_pipe_still_exits_success` instead of finite range (1-5) to guarantee a burst of output immediately after spawn, preventing the process from finishing before stdout closure and avoiding missed broken pipe errors.
1 parent 5be7f83 commit 099a5dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/by-util/test_seq.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ fn test_broken_pipe_still_exits_success() {
1616
use std::process::Stdio;
1717

1818
let mut child = new_ucmd!()
19-
.args(&["1", "5"])
19+
// Use an infinite sequence so a burst of output happens immediately after spawn.
20+
// With small output the process can finish before stdout is closed and the Broken pipe never occurs.
21+
.args(&["inf"])
2022
.set_stdout(Stdio::piped())
2123
.run_no_wait();
2224

0 commit comments

Comments
 (0)