From ab44be142a57023a539b66eb06e795b4924fbc9f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 31 Oct 2019 12:57:42 -0700 Subject: 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 Signed-off-by: Brian Behlendorf Closes #9528 --- .../tests/functional/removal/removal_with_errors.ksh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/zfs-tests') 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 -- cgit v1.2.3