diff options
author | Brian Behlendorf <[email protected]> | 2019-10-31 12:57:42 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-31 12:57:42 -0700 |
commit | ab44be142a57023a539b66eb06e795b4924fbc9f (patch) | |
tree | 9a960832af27badfd55289ab0f475781a5956f6e | |
parent | a5308e252d201b1bcfc8fdfbb49262460a19828c (diff) |
ZTS: Fix removal_with_errors
The removal_with_errors.ksh test case could occasionally complete
the removal process instead of canceling due to an injected error.
To prevent this false positive, export and import the pool between
test phases to flush the ARC cache. Furthermore, double the amount
of data in the pool to increase the removal time.
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #9528
-rwxr-xr-x | tests/zfs-tests/tests/functional/removal/removal_with_errors.ksh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/zfs-tests/tests/functional/removal/removal_with_errors.ksh b/tests/zfs-tests/tests/functional/removal/removal_with_errors.ksh index cb836e92b..9d5143ef8 100755 --- a/tests/zfs-tests/tests/functional/removal/removal_with_errors.ksh +++ b/tests/zfs-tests/tests/functional/removal/removal_with_errors.ksh @@ -83,8 +83,11 @@ FILE_CONTENTS="Leeloo Dallas mul-ti-pass." echo $FILE_CONTENTS >$TESTDIR/$TESTFILE0 log_must [ "x$(<$TESTDIR/$TESTFILE0)" = "x$FILE_CONTENTS" ] -log_must file_write -o create -f $TESTDIR/$TESTFILE1 -b $((2**20)) -c $((2**7)) -sync_pool $TESTPOOL +log_must file_write -o create -f $TESTDIR/$TESTFILE1 -b $((2**20)) -c $((2**8)) + +# Flush the ARC to minimize cache effects. +log_must zpool export $TESTPOOL +log_must zpool import -d $TMPDIR $TESTPOOL # Verify that unexpected read errors automatically cancel the removal. log_must zinject -d $DISK0 -e io -T all -f 100 $TESTPOOL @@ -93,6 +96,10 @@ log_must wait_for_removing_cancel $TESTPOOL log_must vdevs_in_pool $TESTPOOL mirror-0 log_must zinject -c all +# Flush the ARC to minimize cache effects. +log_must zpool export $TESTPOOL +log_must zpool import -d $TMPDIR $TESTPOOL + # Verify that unexpected write errors automatically cancel the removal. log_must zinject -d $DISK3 -e io -T all -f 100 $TESTPOOL log_must zpool remove $TESTPOOL mirror-0 |