]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ZTS: fix wait_scrubbed()
authorTom Caputi <tcaputi@datto.com>
Fri, 14 Dec 2018 18:06:49 +0000 (13:06 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 14 Dec 2018 18:06:49 +0000 (10:06 -0800)
Currently, wait_scrubbed() is the only function of its kind that
accepts a timeout, which is 10s by default. This timeout is pretty
short for a scrub and causes test failures if we run too long. This
patch removes the timeout, instead leaning on the global test suite
timeout to ensure the tests keep moving.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8210

tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/fault/scrub_after_resilver.ksh

index 2effa42074018ed6c6ea97bc103998d9184066a7..482ab5ef51015e196881369254d22f2d6699ae91 100644 (file)
@@ -1029,7 +1029,7 @@ function get_endslice #<disk> <slice>
 
                ((endcyl = (endcyl + 1) / ratio))
        fi
-       
+
        echo $endcyl
 }
 
@@ -3209,15 +3209,10 @@ function wait_replacing #pool
 function wait_scrubbed
 {
        typeset pool=${1:-$TESTPOOL}
-       typeset iter=${2:-10}
-       typeset -i i=0
-       for i in {1..$iter} ; do
-               if is_pool_scrubbed $pool ; then
-                       return 0
-               fi
-               sleep 1
+       while true ; do
+               is_pool_scrubbed $pool && break
+               log_must sleep 1
        done
-       return 1
 }
 
 # Backup the zed.rc in our test directory so that we can edit it for our test.
index 3b124bdd598ed892c15d0acb2ac73bb24be056d6..a5b58ec8ff24158454eb125117340d3c21644526 100755 (executable)
@@ -60,5 +60,5 @@ log_must zpool replace $TESTPOOL $DISK1 $DISK3
 # Wait for the resilver to finish, and then the subsequent scrub to finish.
 # Waiting for the scrub has the effect of waiting for both.  Timeout after 10
 # seconds if nothing is happening.
-log_must wait_scrubbed $TESTPOOL 10
+log_must wait_scrubbed $TESTPOOL
 log_pass "Successfully ran the scrub after resilver zedlet"