start-tests: keep the CPU stress test running for the requested duration - #6
Open
munzzyy wants to merge 1 commit into
Open
start-tests: keep the CPU stress test running for the requested duration#6munzzyy wants to merge 1 commit into
munzzyy wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The only blocking wait in
main()is for the temperature monitor:--cpu-stressis its own option in--help, so you can select it without--temperature. When you do, the script startscpu/cpu_test.shin the background, skips that wait, and falls straight into the kill block a few lines down that reads the PID marker and killsstress-ng.cpu_test.shhas 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 1finished 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-ngstub on PATH that sleeps until killed. Before the change--cpu-stress --time 1took 2s, after it takes 61s (60s plus the existing 1s cleanup sleep).--temperature --cpu-stress --time 1still waits on the monitor rather than adding a second delay.