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/mv/i-3 | |
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/mv/i-3')
-rwxr-xr-x | tests/mv/i-3 | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/mv/i-3 b/tests/mv/i-3 index 4201dfbca..78a252664 100755 --- a/tests/mv/i-3 +++ b/tests/mv/i-3 @@ -38,14 +38,19 @@ test -r /dev/stdin 2>&1 \ || skip_test_ '/dev/stdin is not readable' mv f g < /dev/stdin > out 2>&1 & pid=$! -sleep 1 -kill $pid -# Make sure out contains the prompt. -case "`cat out`" in - "mv: try to overwrite \`g', overriding mode 0000"*) ;; - *) fail=1 ;; -esac +# Wait up to 3.1s for the expected prompt +check_overwrite_prompt() +{ + local delay="$1" + case "`cat out`" in + "mv: try to overwrite \`g', overriding mode 0000"*) ;; + *) sleep $delay; return 1;; + esac +} +retry_delay_ check_overwrite_prompt .1 5 || fail=1 + +kill $pid mv -f h i > out 2>&1 || fail=1 test -f i || fail=1 |