summaryrefslogtreecommitdiff
path: root/tests/rm
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2010-09-07 14:02:56 +0100
committerPádraig Brady <P@draigBrady.com>2010-09-07 14:02:56 +0100
commitc52d220c300c63a93ffd39dd29e89201e6fd929c (patch)
treebd123fa2798df94a07fbb64f75741ca99c42b324 /tests/rm
parent437671accc0af8fa43a3f9bda6c150cb63fc42cb (diff)
downloadcoreutils-c52d220c300c63a93ffd39dd29e89201e6fd929c.tar.xz
tests: make various timeouts more robust
* tests/init.cfg (retry_delay_): Describe the backoff method used. * tests/ls/readdir-mountpoint-inode: Add a timeout to the stat call to eliminate the chance of hangups. * tests/mv/i-3: Change the timeout required to pass from 1 second to a range of .1s - 3.1s. * tests/rm/dangling-symlink: Likewise.
Diffstat (limited to 'tests/rm')
-rwxr-xr-xtests/rm/dangling-symlink15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/rm/dangling-symlink b/tests/rm/dangling-symlink
index 9a3cfd631..270459c5b 100755
--- a/tests/rm/dangling-symlink
+++ b/tests/rm/dangling-symlink
@@ -34,12 +34,15 @@ rm ---presume-input-tty dangle symlink &
pid=$!
# The buggy rm (fileutils-4.1.9) would hang here, waiting for input.
-# Give the working rm a chance to remove the file.
-sleep 1
-
-# The file must no longer exist.
-ls -l dangle > /dev/null 2>&1 && fail=1
-ls -l symlink > /dev/null 2>&1 && fail=1
+# Wait up to 3.1s for rm to remove the files
+check_files_removed() {
+ local delay="$1"
+ local present=0
+ 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; } || :
+}
+retry_delay_ check_files_removed .1 5 || fail=1
kill $pid > /dev/null 2>&1