From 099a5ddfc815df138a03cbabb03084eeee6a0284 Mon Sep 17 00:00:00 2001 From: mattsu Date: Sat, 29 Nov 2025 20:34:42 +0900 Subject: [PATCH] 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. --- tests/by-util/test_seq.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/by-util/test_seq.rs b/tests/by-util/test_seq.rs index de0ad10d9..d5dd526aa 100644 --- a/tests/by-util/test_seq.rs +++ b/tests/by-util/test_seq.rs @@ -16,7 +16,9 @@ fn test_broken_pipe_still_exits_success() { use std::process::Stdio; let mut child = new_ucmd!() - .args(&["1", "5"]) + // Use an infinite sequence so a burst of output happens immediately after spawn. + // With small output the process can finish before stdout is closed and the Broken pipe never occurs. + .args(&["inf"]) .set_stdout(Stdio::piped()) .run_no_wait();