Skip to content

Commit

Permalink
ZTS: Speed up write_dirs cleanup
Browse files Browse the repository at this point in the history
The write_dirs tests fill a filesystem with a bunch of files until it
is full.  In cleanup the files are truncated and removed individually.
These tests already take a while to run.

It is quicker and easier to destroy the whole dataset and create a new
one to replace it in the cleanup functions.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10098
  • Loading branch information
behlendorf committed Mar 4, 2020
1 parent fa23c5b commit 5a1abc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ verify_runnable "both"

function cleanup
{
for file in `find $TESTDIR -type f`; do
cat /dev/null > $file
done
log_must sync
log_must rm -rf $TESTDIR/*
destroy_dataset $TESTPOOL/$TESTFS
zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
}

typeset -i retval=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ verify_runnable "both"

function cleanup
{
for file in `find $TESTDIR -type f`; do
cat /dev/null > $file
done
log_must sync
log_must rm -rf $TESTDIR/*
destroy_dataset $TESTPOOL/$TESTFS
zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
}

typeset -i retval=0
Expand Down

0 comments on commit 5a1abc4

Please sign in to comment.