From 76878a0d517aa6331d77d0934ab454a78b9a71de Mon Sep 17 00:00:00 2001 From: Cole Munz Date: Sun, 26 Jul 2026 22:42:24 -0500 Subject: [PATCH] start-tests: keep the CPU stress test running for the requested duration The only blocking wait in main() is for the temperature monitor, so selecting --cpu-stress without --temperature starts stress-ng and then falls straight through to the kill block a few lines later. cpu_test.sh has no timer of its own ("Duration: Infinite (until killed by main script)"), so the run ends almost immediately and still prints "All tests completed!". ./start-tests.sh --cpu-stress --time 1 finished in 2 seconds on my machine instead of 60. Added a fallback wait for the case where nothing else is keeping time. It's an elif, so runs that include --temperature keep using the monitor as the timekeeper exactly as before. Signed-off-by: Cole Munz --- start-tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/start-tests.sh b/start-tests.sh index fd1813b..bda870c 100755 --- a/start-tests.sh +++ b/start-tests.sh @@ -285,6 +285,11 @@ main() { # Wait for system monitoring to complete if [ "$RUN_TEMPERATURE" = true ]; then wait $MONITOR_PID + elif [ "$RUN_CPU_STRESS" = true ]; then + # Nothing else is keeping time, so hold here for the requested duration. + # cpu_test.sh runs stress-ng until the kill below, so without this the + # stress test gets killed immediately after it starts. + sleep $((TEST_DURATION * 60)) fi # Kill CPU stress test when monitoring is done