mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
cat: don't flake even on exotic pipe buffer sizes
See also 9995c637aa
.
There is a race condition between the writing thread and the command.
It is easily possible that on the developer's machine, the writing
thread is always faster, filling the kernel's buffer of the stdin pipe,
thus succeeding the write. It is also easily possible that on the busy
CI machines, the child command runs first for whatever reason, and exits
early, thus killing the pipe, which causes the later write to fail. This
results in a flaky test. Let's prevent flaky tests.
This commit is contained in:
parent
9fa808fb5e
commit
bcd2d888a1
1 changed files with 2 additions and 0 deletions
|
@ -175,6 +175,7 @@ fn test_piped_to_dev_full() {
|
|||
s.ucmd()
|
||||
.set_stdout(dev_full)
|
||||
.pipe_in_fixture("alpha.txt")
|
||||
.ignore_stdin_write_error()
|
||||
.fails()
|
||||
.stderr_contains("No space left on device");
|
||||
}
|
||||
|
@ -224,6 +225,7 @@ fn test_three_directories_and_file_and_stdin() {
|
|||
"test_directory3",
|
||||
])
|
||||
.pipe_in("stdout bytes")
|
||||
.ignore_stdin_write_error()
|
||||
.fails()
|
||||
.stderr_is_fixture("three_directories_and_file_and_stdin.stderr.expected")
|
||||
.stdout_is(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue