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/ls/readdir-mountpoint-inode | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/ls') diff --git a/tests/ls/readdir-mountpoint-inode b/tests/ls/readdir-mountpoint-inode index 63378b64c..d03ba06f9 100755 --- a/tests/ls/readdir-mountpoint-inode +++ b/tests/ls/readdir-mountpoint-inode @@ -23,7 +23,8 @@ fi . $srcdir/test-lib.sh - +# We use --local here so as to not activate +# potentially very many remote mounts. mount_points=$(df --local -P 2>&1 | sed -n 's,.*[0-9]% \(/.\),\1,p') test -z "$mount_points" && skip_test_ "this test requires a non-root mount point" @@ -60,12 +61,10 @@ inode_via_readdir() eval "ls -i $opts $parent_dir" | sed 's/ .*//' } -# FIXME: use a timeout, in case stat'ing mount points takes too long. - for dir in $mount_points; do readdir_inode=$(inode_via_readdir $dir) test $? = 77 && continue - stat_inode=$(env stat --format=%i $dir) + stat_inode=$(timeout 1 stat --format=%i $dir) # If stat fails or says the inode is 0, skip $dir. case $stat_inode in 0|'') continue;; esac test "$readdir_inode" = "$stat_inode" || fail=1 -- cgit v1.2.3-70-g09d2