diff options
author | Pádraig Brady <P@draigBrady.com> | 2010-09-07 14:02:56 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2010-09-07 14:02:56 +0100 |
commit | c52d220c300c63a93ffd39dd29e89201e6fd929c (patch) | |
tree | bd123fa2798df94a07fbb64f75741ca99c42b324 /tests/rm | |
parent | 437671accc0af8fa43a3f9bda6c150cb63fc42cb (diff) | |
download | coreutils-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-x | tests/rm/dangling-symlink | 15 |
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 |