Skip to content

Commit 20ed8e8

Browse files
committed
ZTS: Add slow_vdev_degraded_sit_out retry
While not common the draid3 vdev type has been observed to not always sit out a vdev when run in the CI. To prevent continued false positives allow the test to be retried up to three times before considering it a failure. Signed-off-by: Brian Behlendorf <[email protected]>
1 parent 88d012a commit 20ed8e8

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

tests/zfs-tests/tests/functional/events/slow_vdev_degraded_sit_out.ksh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ set_tunable64 SIT_OUT_CHECK_INTERVAL 20
6060

6161
log_must truncate -s 150M $TEST_BASE_DIR/vdev.$$.{0..9}
6262

63-
for raidtype in raidz2 raidz3 draid2 draid3 ; do
63+
raidtypes=(raidz2 raidz3 draid2 draid3)
64+
retry=0
65+
66+
for (( t=0; t<4; t++ )); do
67+
raidtype="${raidtypes[$t]}"
68+
6469
log_must zpool create $TESTPOOL2 $raidtype $TEST_BASE_DIR/vdev.$$.{0..9}
6570
log_must zpool set autosit=on $TESTPOOL2 "${raidtype}-0"
6671
log_must dd if=/dev/urandom of=/$TESTPOOL2/bigfile bs=1M count=400
@@ -90,13 +95,24 @@ for raidtype in raidz2 raidz3 draid2 draid3 ; do
9095
fi
9196
done
9297

93-
log_must test "$(get_vdev_prop sit_out $TESTPOOL2 $SLOW_VDEV)" == "on"
94-
9598
# Clear fault injection
9699
log_must zinject -c all
97100

98-
# Wait for us to exit our sit out period
99-
log_must wait_sit_out $TESTPOOL2 $SLOW_VDEV 10
101+
if test "$(get_vdev_prop sit_out $TESTPOOL2 $SLOW_VDEV)" == "on"; then
102+
# Wait for us to exit our sit out period
103+
log_must wait_sit_out $TESTPOOL2 $SLOW_VDEV 10
104+
else
105+
# Depending on exactly how the blocks are laid out and the
106+
# I/O is issued we may not always trigger a sitout. Allow
107+
# up to 3 retries to avoid false positives.
108+
if test $retry -lt 3; then
109+
retry=$((retry + 1))
110+
t=$(($t - 1))
111+
log_note "Retrying $retry/3 $raidtype vdev type"
112+
else
113+
log_fail "Exceeded total allowed retries"
114+
fi
115+
fi
100116

101117
log_must test "$(get_vdev_prop sit_out $TESTPOOL2 $SLOW_VDEV)" == "off"
102118
destroy_pool $TESTPOOL2

0 commit comments

Comments
 (0)