]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ZTS: Wait for free space between quota tests
authorRyan Moeller <ryan@iXsystems.com>
Thu, 26 Mar 2020 17:48:19 +0000 (13:48 -0400)
committerGitHub <noreply@github.com>
Thu, 26 Mar 2020 17:48:19 +0000 (10:48 -0700)
And in removal tests, sync the specific pool we are waiting on.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10146

tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
tests/zfs-tests/tests/functional/removal/removal.kshlib

index 9364a9f60f1cc12573627768d04a02bd27a87060..d6783e9a43ac31f006ec42d897bfb1661e6a769d 100755 (executable)
@@ -62,7 +62,8 @@ function cleanup
        # pool, otherwise next test will fail trying to set a
        # quota which is less than the space used.
        #
-       sleep 5
+       wait_freeing $TESTPOOL
+       sync_pool $TESTPOOL
 }
 
 log_onexit cleanup
index c54968bbccc71668c18dd64ae4f976244742501e..2f34072dd151e22e981a550ed1d50a34c07c42c7 100755 (executable)
@@ -61,6 +61,9 @@ function cleanup
 
        [[ -e $TESTDIR/$TESTFILE2 ]] && \
             log_must rm $TESTDIR/$TESTFILE2
+
+       wait_freeing $TESTPOOL
+       sync_pool $TESTPOOL
 }
 
 log_onexit cleanup
index bec2243f9f36f2e0bd6621acd983d54dcf1fe161..6ab25cf2d46317fa0fb0f85cbac58f0b5f2d4fc7 100755 (executable)
@@ -61,11 +61,12 @@ function cleanup
            log_must rm $TESTDIR1/$TESTFILE1
 
        #
-        # Need to allow time for space to be released back to
-        # pool, otherwise next test will fail trying to set a
-        # quota which is less than the space used.
-        #
-        sleep 5
+       # Need to allow time for space to be released back to
+       # pool, otherwise next test will fail trying to set a
+       # quota which is less than the space used.
+       #
+       wait_freeing $TESTPOOL
+       sync_pool $TESTPOOL
 }
 
 log_onexit cleanup
index cc62d8fa96c7724c4af2aba5ee6ecc8e8e39e0f3..373354438925d306930a4a323e1c36379d3d42d5 100755 (executable)
@@ -62,6 +62,9 @@ function cleanup
 
        [[ -e $TESTDIR1/$TESTFILE2 ]] && \
             log_must rm $TESTDIR1/$TESTFILE2
+
+       wait_freeing $TESTPOOL
+       sync_pool $TESTPOOL
 }
 
 log_onexit cleanup
index 231991e82c574a7cfb8b0bc76cd57aa9bc8abb6b..140ac38ad89807bdeda7fe612985e19fb436c007 100644 (file)
@@ -34,7 +34,7 @@ function wait_for_removal # pool
        # The pool state changes before the TXG finishes syncing; wait for
        # the removal to be completed on disk.
        #
-       sync_pool
+       sync_pool $pool
 
        log_must is_pool_removed $pool
        return 0