ZTS: Wait for free space between write_dirs tests
Cleanup for write_dirs involves destroying a dataset filling a pool and then recreating the dataset for the next test. Due to the asynchronous nature of free space accounting, recreating the dataset can fail for lack of space, causing problems for the next test. Add wait_freeing $TESTPOOL to wait for the space to be freed and then sync_pool $TESTPOOL to update the space accounting before attempting to recreate the test filesystem. Only use a single disk to create the pool. Make it a small file so it does not take too long to fill. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10112
This commit is contained in:
parent
e6b28efccc
commit
e70b127e05
|
@ -32,3 +32,4 @@
|
|||
. $STF_SUITE/include/libtest.shlib
|
||||
|
||||
default_cleanup
|
||||
rm -f $TEST_BASE_DIR/disk0
|
||||
|
|
|
@ -33,4 +33,6 @@
|
|||
|
||||
verify_runnable "global"
|
||||
|
||||
default_setup "$DISKS"
|
||||
DISK=$TEST_BASE_DIR/disk0
|
||||
truncate -s 2G $DISK
|
||||
default_setup $DISK
|
||||
|
|
|
@ -48,6 +48,8 @@ verify_runnable "both"
|
|||
function cleanup
|
||||
{
|
||||
destroy_dataset $TESTPOOL/$TESTFS
|
||||
wait_freeing $TESTPOOL
|
||||
sync_pool $TESTPOOL
|
||||
zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@ verify_runnable "both"
|
|||
function cleanup
|
||||
{
|
||||
destroy_dataset $TESTPOOL/$TESTFS
|
||||
wait_freeing $TESTPOOL
|
||||
sync_pool $TESTPOOL
|
||||
zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue