Skip to content

start-tests: keep the CPU stress test running for the requested duration - #6

Open
munzzyy wants to merge 1 commit into
flipperdevices:devfrom
munzzyy:fix/cpu-stress-runs-full-duration
Open

start-tests: keep the CPU stress test running for the requested duration#6
munzzyy wants to merge 1 commit into
flipperdevices:devfrom
munzzyy:fix/cpu-stress-runs-full-duration

Conversation

@munzzyy

@munzzyy munzzyy commented Jul 27, 2026

Copy link
Copy Markdown

The only blocking wait in main() is for the temperature monitor:

if [ "$RUN_TEMPERATURE" = true ]; then
    wait $MONITOR_PID
fi

--cpu-stress is its own option in --help, so you can select it without --temperature. When you do, the script starts cpu/cpu_test.sh in the background, skips that wait, and falls straight into the kill block a few lines down that reads the PID marker and kills stress-ng. cpu_test.sh has no timer of its own — it says so itself, "Duration: Infinite (until killed by main script)" — so the stress test dies right after it starts and the script still prints "All tests completed!".

./start-tests.sh --cpu-stress --time 1 finished in 2 seconds here instead of 60.

Added a fallback wait for the case where nothing else is keeping time. It's an elif, so any run that includes --temperature (including --all) keeps using the monitor as the timekeeper and is unaffected.

I don't have an RK3576 board, so I tested the orchestration on a Linux box with a stress-ng stub on PATH that sleeps until killed. Before the change --cpu-stress --time 1 took 2s, after it takes 61s (60s plus the existing 1s cleanup sleep). --temperature --cpu-stress --time 1 still waits on the monitor rather than adding a second delay.

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 <colemunz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant