]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid infinite loop in dd failure edge case
authorPádraig Brady <P@draigBrady.com>
Wed, 21 Jan 2026 18:57:53 +0000 (18:57 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 21 Jan 2026 19:00:03 +0000 (19:00 +0000)
* tests/tee/tee.sh: If dd failed, then tee would spin
writing to the fifo forever, so add a timeout protection.
This was noticed with `export LD_PRELOAD=libasan.so.8`
with a non ASAN build, which induced a failure in dd invocations.

tests/tee/tee.sh

index 1ba5d77ad436e25eb51e6143bc2c719b0b6050c7..41d1b9acd1c86b41fb63428ac53f4dcfafbc859b 100755 (executable)
@@ -97,7 +97,7 @@ read_fifo_delayed & pid=$!
 dd count=20 bs=100K if=/dev/zero status=none |
 {
   dd count=0 oflag=nonblock status=none
-  tee || { cleanup_; touch tee.fail; }
+  timeout 10 tee || { cleanup_; touch tee.fail; }
 } >fifo
 test -f tee.fail && fail=1 || cleanup_