From: Wander Lairson Costa <wander@redhat.com>
To: williams@redhat.com, jkacur@redhat.com, juri.lelli@redhat.com,
luffyluo@tencent.com, davidlt@rivosinc.com,
linux-rt-users@vger.kernel.org
Cc: Wander Lairson Costa <wander@redhat.com>
Subject: [PATCH stalld 10/36] tests/functional: Remove redundant post-stop_stalld sleeps
Date: Mon, 30 Mar 2026 16:43:33 -0300 [thread overview]
Message-ID: <20260330194410.103953-11-wander@redhat.com> (raw)
In-Reply-To: <20260330194410.103953-1-wander@redhat.com>
stop_stalld() now guarantees the process is dead before returning,
making the sleep 1 calls that follow it in test scripts redundant.
Remove all 30 occurrences across test_affinity.sh,
test_boost_duration.sh, test_boost_runtime.sh, test_force_fifo.sh,
test_foreground.sh, test_pidfile.sh, and
test_starvation_threshold.sh.
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
---
tests/functional/test_affinity.sh | 7 -------
tests/functional/test_boost_duration.sh | 4 ----
tests/functional/test_boost_runtime.sh | 4 ----
tests/functional/test_force_fifo.sh | 6 ------
tests/functional/test_foreground.sh | 1 -
tests/functional/test_pidfile.sh | 5 -----
tests/functional/test_starvation_threshold.sh | 3 ---
7 files changed, 30 deletions(-)
diff --git a/tests/functional/test_affinity.sh b/tests/functional/test_affinity.sh
index 90dd69f..c3888ba 100755
--- a/tests/functional/test_affinity.sh
+++ b/tests/functional/test_affinity.sh
@@ -89,7 +89,6 @@ else
fi
stop_stalld
-sleep 1
#=============================================================================
# Test 2: Single CPU affinity
@@ -115,7 +114,6 @@ else
fi
stop_stalld
-sleep 1
#=============================================================================
# Test 3: Multi-CPU affinity (CPU list)
@@ -143,7 +141,6 @@ if [ "$num_cpus" -ge 4 ]; then
fi
stop_stalld
- sleep 1
else
log "⊘ SKIP: Test 3 requires at least 4 CPUs"
fi
@@ -173,7 +170,6 @@ if [ "$num_cpus" -ge 4 ]; then
fi
stop_stalld
- sleep 1
else
log "⊘ SKIP: Test 4 requires at least 4 CPUs"
fi
@@ -210,7 +206,6 @@ if [ "$num_cpus" -ge 2 ]; then
fi
stop_stalld
- sleep 1
else
log "⊘ SKIP: Test 5 requires at least 2 CPUs"
fi
@@ -247,7 +242,6 @@ if [ "$num_cpus" -ge 2 ]; then
fi
stop_stalld
- sleep 1
else
log "⊘ SKIP: Test 6 requires at least 2 CPUs"
fi
@@ -318,7 +312,6 @@ else
fi
stop_stalld
-sleep 1
log ""
log "All affinity tests completed"
diff --git a/tests/functional/test_boost_duration.sh b/tests/functional/test_boost_duration.sh
index e9f8928..4df5489 100755
--- a/tests/functional/test_boost_duration.sh
+++ b/tests/functional/test_boost_duration.sh
@@ -84,7 +84,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null || true
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 2: Short duration (1 second)
@@ -123,7 +122,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null || true
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 3: Long duration (10 seconds)
@@ -163,7 +161,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null || true
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 4: Verify task policy is restored after boost duration
@@ -201,7 +198,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null || true
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 5: Invalid duration values
diff --git a/tests/functional/test_boost_runtime.sh b/tests/functional/test_boost_runtime.sh
index 60ccdc6..0475da5 100755
--- a/tests/functional/test_boost_runtime.sh
+++ b/tests/functional/test_boost_runtime.sh
@@ -84,7 +84,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null || true
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 2: Custom runtime (10,000 ns = 10 microseconds, less than default)
@@ -123,7 +122,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null || true
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 3: Larger runtime (100,000 ns = 100 microseconds)
@@ -162,7 +160,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null || true
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 4: Runtime < period (valid configuration)
@@ -203,7 +200,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null || true
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 5: Runtime > period (should error or be rejected)
diff --git a/tests/functional/test_force_fifo.sh b/tests/functional/test_force_fifo.sh
index 704d605..cab8003 100755
--- a/tests/functional/test_force_fifo.sh
+++ b/tests/functional/test_force_fifo.sh
@@ -85,7 +85,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 2: Force FIFO mode (-F)
@@ -134,7 +133,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 3: Verify FIFO priority setting
@@ -175,7 +173,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 4: Verify FIFO emulation behavior (sleep runtime, restore, sleep remainder)
@@ -223,7 +220,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 5: Single-threaded mode with FIFO (should fail/exit)
@@ -285,7 +281,6 @@ log "ℹ INFO: SCHED_DEADLINE boosts: $deadline_boosts"
kill -TERM "${STARVE_PID}" 2>/dev/null
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
# Run with FIFO
STALLD_LOG_FIFO="/tmp/stalld_test_force_fifo_comparison_$$.log"
@@ -304,7 +299,6 @@ log "ℹ INFO: SCHED_FIFO boosts: $fifo_boosts"
kill -TERM "${STARVE_PID}" 2>/dev/null
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
log "ℹ INFO: Comparison complete (DEADLINE: $deadline_boosts, FIFO: $fifo_boosts)"
diff --git a/tests/functional/test_foreground.sh b/tests/functional/test_foreground.sh
index 693d4b1..c5afbba 100755
--- a/tests/functional/test_foreground.sh
+++ b/tests/functional/test_foreground.sh
@@ -45,7 +45,6 @@ if assert_process_running "${STALLD_PID}" "stalld should be running"; then
fi
stop_stalld
-sleep 1
# Test 2: With -f flag, stalld should stay in foreground
echo ""
diff --git a/tests/functional/test_pidfile.sh b/tests/functional/test_pidfile.sh
index 675b15e..155855e 100755
--- a/tests/functional/test_pidfile.sh
+++ b/tests/functional/test_pidfile.sh
@@ -68,7 +68,6 @@ if [ $default_found -eq 0 ]; then
fi
stop_stalld
-sleep 1
#=============================================================================
# Test 2: Custom pidfile location
@@ -112,7 +111,6 @@ fi
log ""
log "Test 3: Verify pidfile removed on clean shutdown"
stop_stalld
-sleep 1
if [ ! -f "${custom_pidfile}" ]; then
log "✓ PASS: Pidfile removed on clean shutdown"
@@ -156,7 +154,6 @@ else
fi
stop_stalld
-sleep 1
#=============================================================================
# Test 5: Test with foreground mode
@@ -192,7 +189,6 @@ else
fi
stop_stalld
-sleep 1
#=============================================================================
# Test 6: Invalid pidfile path (permission denied)
@@ -278,7 +274,6 @@ else
fi
stop_stalld
-sleep 1
log ""
log "All pidfile tests completed"
diff --git a/tests/functional/test_starvation_threshold.sh b/tests/functional/test_starvation_threshold.sh
index c2dda57..41a2cca 100755
--- a/tests/functional/test_starvation_threshold.sh
+++ b/tests/functional/test_starvation_threshold.sh
@@ -98,7 +98,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 2: Verify no detection before threshold
@@ -149,7 +148,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 3: Shorter threshold (3 seconds)
@@ -197,7 +195,6 @@ fi
kill -TERM "${STARVE_PID}" 2>/dev/null
wait "${STARVE_PID}" 2>/dev/null || true
stop_stalld
-sleep 1
#=============================================================================
# Test 4: Invalid threshold values
--
2.53.0
next prev parent reply other threads:[~2026-03-30 19:46 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 19:43 [PATCH stalld 00/36] tests: Replace timing-dependent synchronization with event-driven helpers Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 01/36] tests: Add pre-test and post-test cleanup of stalld processes Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 02/36] tests/helpers: Fix stalld daemon detection in start_stalld() Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 03/36] tests/helpers: Remove duplicate log() function Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 04/36] tests: Add per-test runtime measurement to run_tests.sh Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 05/36] tests/functional: Fix and refactor test_backend_selection.sh Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 06/36] tests/functional: Fix test_logging_destinations.sh path and backend Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 07/36] tests/helpers: Replace sleep with poll in start_stalld_with_log() Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 08/36] tests/helpers: Fix stop_stalld() timeout and shutdown logic Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 09/36] tests/helpers: Fix relative path in backend detection functions Wander Lairson Costa
2026-03-30 19:43 ` Wander Lairson Costa [this message]
2026-03-30 19:43 ` [PATCH stalld 11/36] tests/functional: Fix false positive log matching in test_logging_destinations Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 12/36] tests/helpers: Rewrite wait_for_log_message() with process substitution Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 13/36] tests/helpers: Add wait_for_stalld_ready() and use in start_stalld_with_log() Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 14/36] tests/helpers: Fix fractional sleep timeout bugs Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 15/36] tests/helpers: Flush stdout after starvation_gen startup messages Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 16/36] tests/helpers: Add start_starvation_gen() helper function Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 17/36] tests/helpers: Add wait_for_starvation_detected() and wait_for_boost_detected() Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 18/36] tests/functional: Use start_starvation_gen() helper Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 19/36] tests/functional: Replace detection sleeps with event-driven helpers Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 20/36] tests/functional: Remove duplicated -a flag in test_fifo_priority_starvation Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 21/36] tests/functional: Add missing -a flag in test_starvation_detection Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 22/36] tests/functional: Use start_stalld_with_log() in test_log_only Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 23/36] tests/functional: Use start_stalld_with_log() in test_logging_destinations Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 24/36] tests/functional: Use start_stalld_with_log() in test_cpu_selection Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 25/36] tests/functional: Use wait_for_stalld_ready() in test_backend_selection Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 26/36] tests/functional: Use timeout for error path in test_force_fifo Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 27/36] tests/functional: Use timeout for invalid argument tests Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 28/36] tests: Add pass() helper and replace assert_equals hack Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 29/36] tests/functional: Use pass() for all test pass reporting Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 30/36] tests: Add fail() helper and use for all test failures Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 31/36] tests/helpers: Use pass()/fail() in assert functions Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 32/36] tests/functional: Fix multi-CPU detection in test_starvation_detection Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 33/36] tests/functional: Accept FIFO fallback in test_fifo_boosting Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 34/36] tests/functional: Fix readiness detection and FIFO fallback in test_force_fifo Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 35/36] tests/functional: Fix invalid pidfile test in test_pidfile Wander Lairson Costa
2026-03-30 19:43 ` [PATCH stalld 36/36] stalld: die on invalid CPU affinity Wander Lairson Costa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260330194410.103953-11-wander@redhat.com \
--to=wander@redhat.com \
--cc=davidlt@rivosinc.com \
--cc=jkacur@redhat.com \
--cc=juri.lelli@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=luffyluo@tencent.com \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox