From e91d0bd14fbf5426cd1fe438cd29cf987c0cc1d9 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 25 Feb 2024 17:56:04 +0100 Subject: [PATCH] uniq: fix flaky test gnu_tests 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. --- tests/by-util/test_uniq.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/by-util/test_uniq.rs b/tests/by-util/test_uniq.rs index 7ebc5c482e9..8b791e6c0c8 100644 --- a/tests/by-util/test_uniq.rs +++ b/tests/by-util/test_uniq.rs @@ -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), @@ -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),