]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: adjust delays to avoid false positives
authorPádraig Brady <P@draigBrady.com>
Mon, 18 Jan 2016 12:41:36 +0000 (12:41 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 18 Jan 2016 15:32:17 +0000 (15:32 +0000)
* tests/rm/dangling-symlink.sh: The effective delay was only
1.5s.  So delay before the operation, and increase the iteration
count by 1 to increase the delay to 6.3s.  This failure was
noticed once on a FreeBSD 10.2 x86_64 virtual machine.
* tests/dd/stats.sh: Remove quotes on sleep argument
to ensure arguments are accumulated appropriately.
* tests/du/move-dir-while-traversing.sh: sleep before operation,
to increase the effective delay from 1.6s to 3.2s.
* tests/tail-2/flush-initial.sh: Likewise.
* tests/tail-2/pipe-f2.sh: Sleep first so that the effective delay
matches the commented value.

tests/dd/stats.sh
tests/du/move-dir-while-traversing.sh
tests/rm/dangling-symlink.sh
tests/tail-2/flush-initial.sh
tests/tail-2/pipe-f2.sh

index 182d5e7e73894da0d785d50205eb49f13010308f..f87d2dab290e6dd82de693daa93da3024ceb8179 100755 (executable)
@@ -67,7 +67,7 @@ done
 
 progress_output()
 {
-  { sleep "$1"; echo 1; } | dd bs=1 status=progress of=/dev/null 2>err
+  { sleep $1; echo 1; } | dd bs=1 status=progress of=/dev/null 2>err
   # Progress output should be for "byte copied", while final is "bytes ..."
   grep 'byte copied' err
 }
index 97eb612b61ed6d9aed24adda0e8c9fc3d358ca1a..e80e94cb73dea29770df42c02283016ba8eb08f5 100755 (executable)
@@ -81,7 +81,7 @@ trap '' TSTP
 timeout 6 ./inotify-watch-for-dir-access.py $t/3/a/b > start-msg & pid=$!
 
 # Wait for the watcher to start...
-nonempty() { test -s start-msg || { sleep $1; return 1; }; }
+nonempty() { sleep $1; test -s start-msg; }
 retry_delay_ nonempty .1 5 || fail=1
 
 # The above watches for an IN_OPEN event on $t/3/a/b,
index a2c760afaca7f14f22c2a0a5fec4214189448a76..7f573bc827996ace92420e6f5c641c2573f575d1 100755 (executable)
@@ -31,15 +31,15 @@ cleanup_() { kill $pid 2>/dev/null && wait $pid; }
 rm ---presume-input-tty dangle symlink & pid=$!
 # The buggy rm (fileutils-4.1.9) would hang here, waiting for input.
 
-# Wait up to 3.1s for rm to remove the files
+# Wait up to 6.3s for rm to remove the files
 check_files_removed() {
-  local delay="$1"
   local present=0
+  sleep $1
   ls -l dangle > /dev/null 2>&1 && present=1
   ls -l symlink > /dev/null 2>&1 && present=1
-  test $present = 1 && { sleep $delay; return 1; } || :
+  test $present = 0
 }
-retry_delay_ check_files_removed .1 5 || fail=1
+retry_delay_ check_files_removed .1 6 || fail=1
 
 cleanup_
 
index 630cc5fc8a3f6ecfd4a7d0a483b7773db893a564..803502ad70ee288c36ac91f2ba9095306c6e1067 100755 (executable)
@@ -34,9 +34,8 @@ tail $fastpoll -f in > out & pid=$!
 tail_flush()
 {
   local delay="$1"
-
-  test -s out ||
-    { sleep "$delay"; return 1; }
+  sleep $delay
+  test -s out
 }
 retry_delay_ tail_flush .1 5 || fail=1
 
index d91de58546b991a7dcbb78de864898a9fb186c12..70fb3bdc12feabc35b3ccbcff81b654e524753bf 100755 (executable)
@@ -32,11 +32,7 @@ fastpoll='-s.1 --max-unchanged-stats=1'
 
 timeout 10 tail $fastpoll -f fifo > out & pid=$!
 
-check_tail_output()
-{
-  local n_sec="$1"
-  test -s out || { sleep $n_sec; return 1; }
-}
+check_tail_output() { sleep $1; test -s out; }
 
 # Wait 12.7s for tail to write something.
 retry_delay_ check_tail_output .1 7 || fail=1