From 500b44eef286870e5cb8447c75ce007ef992f840 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 7 May 2026 09:54:45 -0700 Subject: [PATCH] ZTS: zpool_iostat_002_pos remove sleep In the CI environment commands may occasionally take longer than expected. For zpool_iostat_002_pos this can cause a failure if fewer than the expected numbers of lines are logged in time. To prevent this issue relax the time constraint and simply verify the command ran to completion and generate the correct number of lines. Reviewed-by: Tony Hutter Signed-off-by: Brian Behlendorf Closes #18501 --- .../cli_user/zpool_iostat/zpool_iostat_002_pos.ksh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh index a2b3464b2bf..b1c12f1306a 100755 --- a/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_user/zpool_iostat/zpool_iostat_002_pos.ksh @@ -38,9 +38,8 @@ # # STRATEGY: # 1. Set the interval to 1 and count to 4. -# 2. Sleep for 5 seconds. -# 3. Verify that the output has 4 records. -# 4. Set interval to 0.5 and count to 1 to test floating point intervals. +# 2. Verify that the output has 4 records. +# 3. Set interval to 0.5 and count to 1 to test floating point intervals. verify_runnable "both" @@ -61,8 +60,7 @@ if ! is_global_zone ; then TESTPOOL=${TESTPOOL%%/*} fi -log_must eval "zpool iostat $TESTPOOL 1 4 > $tmpfile 2>&1 &" -log_must sleep 5 +log_must eval "zpool iostat $TESTPOOL 1 4 > $tmpfile 2>&1" stat_count=$(grep -c $TESTPOOL $tmpfile) if [[ $stat_count -ne 4 ]]; then