Skip to content

fix broken pipe error in tests/common/util#3910

Merged
sylvestre merged 2 commits intouutils:mainfrom
Joining7943:3895-fix-broken-pipe-error-in-utils
Sep 12, 2022
Merged

fix broken pipe error in tests/common/util#3910
sylvestre merged 2 commits intouutils:mainfrom
Joining7943:3895-fix-broken-pipe-error-in-utils

Conversation

@Joining7943
Copy link
Copy Markdown
Contributor

Fixes #3895

@tertsdiepraam
Copy link
Copy Markdown
Collaborator

Interesting! How did you get to this solution and why does it work?

@Joining7943
Copy link
Copy Markdown
Contributor Author

Yes it is. I came to this solution because I usually use a buffer like BufReader or BufWriter around a bare Stdin, Stdout etc. to reduce system calls and improve performance. I tried different things, but this one stopped the test failing. However, I'm not sure about the reason. I guess it's because the BufWriter calls flush() when dropped.

@sylvestre sylvestre force-pushed the 3895-fix-broken-pipe-error-in-utils branch 2 times, most recently from 462d68a to 07b04b0 Compare September 9, 2022 18:43
@sylvestre sylvestre force-pushed the 3895-fix-broken-pipe-error-in-utils branch from 07b04b0 to 795ab1f Compare September 10, 2022 09:10
@Joining7943
Copy link
Copy Markdown
Contributor Author

Is tests/common/util somehow involved in the gnu tests?

@sylvestre
Copy link
Copy Markdown
Contributor

No, we have this test failing from time to time (tee)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tail: tests with piped input are failing randomly with broken pipe on macos when no output is expected

3 participants