Skip to content

tests: don't pipe input into commands that exit before reading it - #14431

Merged
cakebaker merged 1 commit into
uutils:mainfrom
Socialpranker:tests-pipe-in-race
Sep 8, 2026
Merged

cakebaker merged 1 commit into
uutils:mainfrom
Socialpranker:tests-pipe-in-race

Conversation

@Socialpranker

Copy link
Copy Markdown
Contributor

sort -t==, sort -t=a and numfmt --from-unit -1 / --from -x fail while parsing their arguments, so they never read stdin. The pipe_in thread writes into a pipe whose read end is already closed, and the test fails with failed to write to stdin of child: Broken pipe (os error 32) — intermittently, depending on which side wins.

I hit this on my own test in #14400, then saw the same failure on test_sort::test_separator_attached_equals_multi_char in an unrelated PR, so it is a class rather than one test.

None of these four tests need input, so they now pipe nothing.

To find the rest of the class I temporarily added a sleep before the write in pipe_in, which turns the race into a deterministic failure, and ran the whole suite: these four are the only ones. That probe is not part of this PR.

sort -t== and numfmt --from-unit -1 fail while parsing arguments, so they
never read stdin. The pipe_in thread races that exit and intermittently
fails the test with "failed to write to stdin of child: Broken pipe".
These four tests do not need input at all, so pipe nothing.
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 153.09 MB (+904 KB, +0.58%)

Significant per-binary changes:
  expr     2.76 MB ->    3.65 MB  (+908 KB, +32.11%)

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/dd/misc. tests/dd/misc is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/df/over-mount-device. tests/df/over-mount-device is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cat/splice is no longer failing!
Congrats! The gnu test tests/cp/cp-a-selinux is no longer failing!
Congrats! The gnu test tests/cut/cut is no longer failing!
Congrats! The gnu test tests/cut/mb-non-utf8 is no longer failing!
Congrats! The gnu test tests/dd/partial-write is no longer failing!
Congrats! The gnu test tests/expand/mb is no longer failing!
Congrats! The gnu test tests/ls/stat-free-symlinks is no longer failing!
Congrats! The gnu test tests/misc/close-stdout is no longer failing!
Congrats! The gnu test tests/mktemp/write-error is no longer failing!
Congrats! The gnu test tests/mv/dir2dir is no longer failing!
Congrats! The gnu test tests/mv/mv-exchange is no longer failing!
Congrats! The gnu test tests/nl/multibyte is no longer failing!
Congrats! The gnu test tests/od/od-float is no longer failing!
Congrats! The gnu test tests/od/od-j is no longer failing!
Congrats! The gnu test tests/ptx/ptx-overrun is no longer failing!
Congrats! The gnu test tests/sort/sort-merge-fdlimit is no longer failing!
Congrats! The gnu test tests/unexpand/mb is no longer failing!
Note: The gnu test tests/dd/fail-ftruncate-fstat was skipped on 'main' but is now failing.

@cakebaker
cakebaker merged commit 8118c24 into uutils:main Sep 8, 2026
96 of 97 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks!

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.

2 participants