-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tail: tests with piped input are failing randomly with broken pipe on macos when no output is expected #3895
Comments
I tried something to get to the root of the problem. To see, if tail is the cause or the test system and because tail and head have pretty similar options and structure without sharing common code (as far as I've seen), I ran this code in #[test]
fn test_force_broken_pipe() {
for i in 0..10000 {
dbg!(i);
let test_string = "a\nb\n";
new_ucmd!()
.args(&["-n", "0"])
.pipe_in(test_string)
.succeeds()
.no_stdout()
.no_stderr();
}
} with the following result for
and for
The broken pipe occurs far more often on macos, and I needed an upper limit of 10000 runs for the for loop on linux to provoke the broken pipe error reliably. I guess this can also at least partly explain why we're running into a todo() in |
… input in UCommand
… input in UCommand
… input in UCommand
… input in UCommand
… input in UCommand
Sorry to return back to this, but I explored it.
coreutils/src/uu/tail/src/tail.rs Lines 241 to 250 in 78a9f6e
So add
coreutils/src/uu/head/src/take.rs Lines 78 to 81 in 78a9f6e
So what I wanted to say is |
I also have an idea, that because Broken pipe happens before we actually observe what the And also it could be that running into |
Here's the reference to the original discussion:
Originally posted by @jhscheer in #3874 (comment)
EDIT:
Here's the exact message from one of the failing tests during the CICD #8262 (https://github.com/uutils/coreutils/actions/runs/2939929799) run:
Looking at the code around
tests/common/util.rs:1115
the childtarget/debug/coreutils tail -n 0
seams to have closed its stdin already when trying to write to its stdin. But maybe I'm wrong. Strange that it happens only on macos.The text was updated successfully, but these errors were encountered: