Debug auto_replace_001_pos failures

Reduced the timeout to 60 seconds which should be more than
sufficient and allow the test to be marked as FAILED rather
than KILLED.  Also dump the pool status on cleanup.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #14829
This commit is contained in:
Brian Behlendorf 2023-05-09 08:57:02 -07:00 committed by GitHub
parent d38c815fe2
commit c8b3dda186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 5 deletions

View File

@ -1951,6 +1951,7 @@ function check_pool_status # pool token keyword <verbose>
# is_pool_removing - to check if the pool removing is a vdev # is_pool_removing - to check if the pool removing is a vdev
# is_pool_removed - to check if the pool remove is completed # is_pool_removed - to check if the pool remove is completed
# is_pool_discarding - to check if the pool checkpoint is being discarded # is_pool_discarding - to check if the pool checkpoint is being discarded
# is_pool_replacing - to check if the pool is performing a replacement
# #
function is_pool_resilvering #pool <verbose> function is_pool_resilvering #pool <verbose>
{ {
@ -1997,6 +1998,10 @@ function is_pool_discarding #pool
{ {
check_pool_status "$1" "checkpoint" "discarding" check_pool_status "$1" "checkpoint" "discarding"
} }
function is_pool_replacing #pool
{
zpool status "$1" | grep -qE 'replacing-[0-9]+'
}
function wait_for_degraded function wait_for_degraded
{ {
@ -2983,12 +2988,15 @@ function wait_freeing #pool
# Wait for every device replace operation to complete # Wait for every device replace operation to complete
# #
# $1 pool name # $1 pool name
# $2 timeout
# #
function wait_replacing #pool function wait_replacing #pool timeout
{ {
typeset timeout=${2:-300}
typeset pool=${1:-$TESTPOOL} typeset pool=${1:-$TESTPOOL}
while zpool status $pool | grep -qE 'replacing-[0-9]+'; do for (( timer = 0; timer < $timeout; timer++ )); do
log_must sleep 1 is_pool_replacing $pool || break;
sleep 1;
done done
} }

View File

@ -54,6 +54,7 @@ fi
function cleanup function cleanup
{ {
zpool status $TESTPOOL
destroy_pool $TESTPOOL destroy_pool $TESTPOOL
sed -i '/alias scsidebug/d' $VDEVID_CONF sed -i '/alias scsidebug/d' $VDEVID_CONF
unload_scsi_debug unload_scsi_debug
@ -99,8 +100,8 @@ block_device_wait
insert_disk $SD $SD_HOST insert_disk $SD $SD_HOST
# Wait for the new disk to be online and replaced # Wait for the new disk to be online and replaced
log_must wait_vdev_state $TESTPOOL "scsidebug" "ONLINE" $MAXTIMEOUT log_must wait_vdev_state $TESTPOOL "scsidebug" "ONLINE" 60
log_must wait_replacing $TESTPOOL log_must wait_replacing $TESTPOOL 60
# Validate auto-replace was successful # Validate auto-replace was successful
log_must check_state $TESTPOOL "" "ONLINE" log_must check_state $TESTPOOL "" "ONLINE"