[PATCH stalld 26/52] tests: Reduce default wait timeouts

Wander Lairson Costa <[email protected]> Mon, 8 Jun 2026 15:31:36 -0300
Newsgroups org.kernel.vger.linux-rt-users
Message-ID <[email protected]>
Failing tests currently hang for up to thirty seconds before reporting
a failure. Reduce the default wait timeouts in the stalld test helpers
to cut this failure reporting time in half. These timeouts only impact
the failure path since passing tests utilize event-driven waits that
return immediately upon matching a pattern.

Decrease the timeout from thirty to fifteen seconds for the starvation
and boost detection waits, their assertion wrappers, and the log match
helper. Reduce the stalld ready wait from fifteen to five seconds. The
new fifteen second limit provides adequate margin because all callers
relying on the default use thresholds of three to five seconds, making
detection take approximately nine seconds.

Override the timeout explicitly to twenty seconds for the third test in
test_boost_duration.sh. This specific caller uses a threshold of ten,
which makes the new fifteen second default too tight.

Signed-off-by: Wander Lairson Costa <[email protected]>
---
 tests/functional/test_boost_duration.sh |  2 +-
 tests/helpers/test_helpers.sh           | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/functional/test_boost_duration.sh b/tests/functional/test_boost_duration.sh
index 3d6a823..821dffe 100755
--- a/tests/functional/test_boost_duration.sh
+++ b/tests/functional/test_boost_duration.sh
@@ -74,7 +74,7 @@ log "Creating starvation on CPU ${TEST_CPU} for ${long_starvation}s"
 start_starvation_gen -c "${TEST_CPU}" -p 80 -n 2 -d ${long_starvation}
 
 # Wait for actual boosting
-assert_boost_detected "${STALLD_LOG}" "Boost with ${long_duration}s duration"
+assert_boost_detected "${STALLD_LOG}" "Boost with ${long_duration}s duration" 20
 
 # Cleanup
 cleanup_scenario "${STARVE_PID}"
diff --git a/tests/helpers/test_helpers.sh b/tests/helpers/test_helpers.sh
index 5187f0f..af341e0 100755
--- a/tests/helpers/test_helpers.sh
+++ b/tests/helpers/test_helpers.sh
@@ -159,7 +159,7 @@ find_starved_child() {
 assert_starvation_detected() {
 	local log_file=$1
 	local message=${2:-"Starvation detected"}
-	local timeout=${3:-30}
+	local timeout=${3:-15}
 	local cpu=${4:-}
 
 	if wait_for_starvation_detected "${log_file}" "${timeout}" "${cpu}"; then
@@ -176,7 +176,7 @@ assert_starvation_detected() {
 assert_boost_detected() {
 	local log_file=$1
 	local message=${2:-"Boost detected"}
-	local timeout=${3:-30}
+	local timeout=${3:-15}
 
 	if wait_for_boost_detected "${log_file}" "${timeout}"; then
 		pass "${message}"
@@ -695,7 +695,7 @@ wait_for_log_message() {
 # Usage: wait_for_stalld_ready <log_file> [timeout]
 wait_for_stalld_ready() {
 	local log_file=$1
-	local timeout=${2:-15}
+	local timeout=${2:-5}
 	wait_for_log_message "checking cpu\|waiting tasks\|skipping" "${timeout}" "${log_file}"
 }
 
@@ -704,7 +704,7 @@ wait_for_stalld_ready() {
 # Usage: wait_for_starvation_detected <log_file> [timeout] [cpu]
 wait_for_starvation_detected() {
 	local log_file=$1
-	local timeout=${2:-30}
+	local timeout=${2:-15}
 	local cpu=${3:-}
 	local pattern="starved on CPU"
 	if [ -n "${cpu}" ]; then
@@ -718,7 +718,7 @@ wait_for_starvation_detected() {
 # Usage: wait_for_boost_detected <log_file> [timeout]
 wait_for_boost_detected() {
 	local log_file=$1
-	local timeout=${2:-30}
+	local timeout=${2:-15}
 	wait_for_log_message "boosted pid" "${timeout}" "${log_file}"
 }
 
@@ -729,7 +729,7 @@ wait_for_n_log_matches() {
 	local pattern=$1
 	local count=$2
 	local log_file=$3
-	local timeout=${4:-30}
+	local timeout=${4:-15}
 	local end=$((SECONDS + timeout))
 
 	while [ $SECONDS -lt $end ]; do
-- 
2.54.0