summaryrefslogtreecommitdiff
path: root/tests/mv/i-3
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/mv/i-3
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/mv/i-3')
-rwxr-xr-xtests/mv/i-319
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