Skip to content

Commit

Permalink
uniq: fix flaky test gnu_tests
Browse files Browse the repository at this point in the history
The testcase tries to write to the stdin pipe while the process under
test is simultaneously exiting with an error code. Naturally, this is a
race, and we should ignore any stdin write errors. However, adding this
feature to the list makes it even more unreadable, and adds no real
value, so let's skip the input data entirely.
  • Loading branch information
BenWiederhake committed Feb 25, 2024
1 parent d7a09c0 commit e91d0bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/by-util/test_uniq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ fn gnu_tests() {
TestCase {
name: "112",
args: &["-D", "-c"],
input: "a a\na b\n",
input: "", // Note: Different from GNU test, but should not matter
stdout: Some(""),
stderr: Some("uniq: printing all duplicated lines and repeat counts is meaningless\nTry 'uniq --help' for more information.\n"),
exit: Some(1),
Expand Down Expand Up @@ -811,7 +811,7 @@ fn gnu_tests() {
TestCase {
name: "119",
args: &["--all-repeated=badoption"],
input: "a a\na b\n",
input: "", // Note: Different from GNU test, but should not matter
stdout: Some(""),
stderr: Some("uniq: invalid argument 'badoption' for '--all-repeated'\nValid arguments are:\n - 'none'\n - 'prepend'\n - 'separate'\nTry 'uniq --help' for more information.\n"),
exit: Some(1),
Expand Down

0 comments on commit e91d0bd

Please sign in to comment.