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 <ryan@ixsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9528
This commit is contained in:
Brian Behlendorf 2019-10-31 12:57:42 -07:00 committed by GitHub
parent a5308e252d
commit ab44be142a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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