Skip to content

Commit

Permalink
ZTS: Wait for free space between quota tests
Browse files Browse the repository at this point in the history
And in removal tests, sync the specific pool we are waiting on.

Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes openzfs#10146
  • Loading branch information
Ryan Moeller authored and jsai20 committed Mar 30, 2021
1 parent 9b4cdc9 commit 87af11b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ function cleanup

[[ -e $TESTDIR/$TESTFILE2 ]] && \
log_must rm $TESTDIR/$TESTFILE2

wait_freeing $TESTPOOL
sync_pool $TESTPOOL
}

log_onexit cleanup
Expand Down
11 changes: 6 additions & 5 deletions tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ function cleanup

[[ -e $TESTDIR1/$TESTFILE2 ]] && \
log_must rm $TESTDIR1/$TESTFILE2

wait_freeing $TESTPOOL
sync_pool $TESTPOOL
}

log_onexit cleanup
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/tests/functional/removal/removal.kshlib
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 87af11b

Please sign in to comment.