From c52d220c300c63a93ffd39dd29e89201e6fd929c Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Tue, 7 Sep 2010 14:02:56 +0100 Subject: 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. --- tests/mv/i-3 | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'tests/mv/i-3') 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 -- cgit v1.2.3-54-g00ecf