]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: tail-2/inotify-rotate: fix a false failure on NFS
authorPádraig Brady <P@draigBrady.com>
Sat, 9 Feb 2013 04:39:40 +0000 (04:39 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 10 Feb 2013 05:05:38 +0000 (05:05 +0000)
* tests/tail-2/inotify-rotate.sh: Avoid a subshell with bash,
which in turn causes the `kill` to be ineffective to the tail
processes (as the SIGTERM is sent to the subshell which doesn't
propagate the signal on to its children).  On NFS the test
cleanup will then fail as there will be .nfs files maintained
in the directory for the files still opened by the tail processes.
Reported by Bernhard Voelker.

tests/tail-2/inotify-rotate.sh

index 94c2b7d7b3a8186fba0d26e1b6cdcae98afb84c5..4a16202d216b7b6f8427e6035a6c6d1eac4f25fe 100755 (executable)
@@ -47,7 +47,8 @@ for i in $(seq 50); do
     # Normally less than a second is required here, but with heavy load
     # and a lot of disk activity, even 20 seconds is insufficient, which
     # leads to this timeout killing tail before the "ok" is written below.
-    :>k && :>x && timeout 40 tail -F k > out 2>&1 &
+    :>k && :>x || framework_failure_ failed to initialize files
+    timeout 40 tail -F k > out 2>&1 &
     pid=$!
     sleep .1
     echo b > k;
@@ -65,4 +66,5 @@ for i in $(seq 50); do
     test $found = 0 && { cat out; fail_ failed to detect echoed '"ok"'; }
 done
 
+wait
 Exit $fail