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/rm/dangling-symlink | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tests/rm') 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 -- cgit v1.2.3-54-g00ecf