]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: shred: fix intermittent false failure
authorPádraig Brady <P@draigBrady.com>
Wed, 3 Jun 2026 21:14:04 +0000 (22:14 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 3 Jun 2026 21:17:01 +0000 (22:17 +0100)
* tests/shred/fifo.sh: Fix (unreleased) racy test.

tests/shred/fifo.sh

index c7c3ac235296861eba7ec366cf27cc42a7544c0f..4e7a1c487f38211970a294309b382f12805ab1cb 100755 (executable)
@@ -62,10 +62,10 @@ cleanup_() { kill $pid 2>/dev/null && wait $pid; }
 
 # Test 'shred' on a FIFO with a reader.  After the file descriptor is
 # opened, 'cat' will be unblocked.
-timeout 10 cat pipe > /dev/null & pid=$!
+timeout 10 cat fifo > /dev/null & pid=$!
 returns_ 1 timeout 10 shred fifo >out 2>err || fail=1
 compare /dev/null out || fail=1
 compare exp err || fail=1
-kill -0 $pid && fail=1
+wait $pid || fail=1  # on cat timeout
 
 Exit $fail