From e73ecbd5d6e758d0a213e47431fe17f36ae97aea Mon Sep 17 00:00:00 2001 From: Tony Hutter Date: Mon, 24 Jun 2024 11:12:58 -0700 Subject: [PATCH] ZTS: Add timeout to cp_stress cp_stress is getting killed on the new QEMU-based github runners we're developing. The problem is that the QEMU-based testers are so underpowered that the test is taking longer than the 10min maximum that ZTS enforces. Instead, enforce an inter-test-cp_stress timeout so the entire test doesn't get killed. Signed-off-by: Tony Hutter --- .../tests/functional/cp_files/cp_stress.ksh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh b/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh index 43bb8ab572d2..62a53f228f65 100755 --- a/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh +++ b/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh @@ -65,8 +65,18 @@ else fi for i in $(seq 1 $RUNS) ; do - # Each run takes around 12 seconds. - log_must $STF_SUITE/tests/functional/cp_files/seekflood 2000 $CPUS + # We have a maximum of 10min per ZTS test, so each seekflood run must + # be a fraction of that. We need to add this timeout in so underpowered + # test runners don't get killed by ZTS and counted as a failure. + TO=$((600 / $RUNS)) + timeout $TO $STF_SUITE/tests/functional/cp_files/seekflood 2000 $CPUS + rc=$? + if [ $rc == 124 ] ; then + # If 'timeout' returns a 124 return code, then it timed out. + log_note "seekflood test timed out. Assume we're just underpowered." + elif [ $rc != 0 ] ; then + log_fail "seekflood test failed with rc=$rc" + fi done cd "$MYPWD"