Skip to content

tests: Comprehensive suite hardening and fail-fast

Wander Lairson Costa linux-rt-users 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23stalld: Reject --force_fifo in single-threaded modesrc/utils.c tests/functional/test_force_fifo.sh+4 -230 replies
2/23tests: Introduce test_section() helpertests/functional/test_affinity.sh tests/functional/test_backend_selection.sh tests/functional/test_boost_duration.sh +17 more+124 -4150 replies
3/23tests: Introduce cleanup_scenario() helpertests/functional/test_boost_duration.sh tests/functional/test_boost_period.sh tests/functional/test_boost_restoration.sh +12 more+71 -1770 replies
4/23tests: Introduce starvation and boost assertstests/functional/test_boost_duration.sh tests/functional/test_boost_period.sh tests/functional/test_boost_runtime.sh +4 more+54 -880 replies
5/23tests: Introduce find_starved_child() helpertests/functional/test_boost_restoration.sh tests/functional/test_deadline_boosting.sh tests/functional/test_fifo_boosting.sh +4 more+79 -1310 replies
6/23tests: Fix task exit timing in test_boost_restorationtests/functional/test_boost_restoration.sh tests/functional/test_runqueue_parsing.sh+11 -110 replies
7/23tests: Consolidate and adopt init_functional_test()tests/functional/test_affinity.sh tests/functional/test_boost_duration.sh tests/functional/test_boost_period.sh +12 more+64 -5180 replies
8/23tests: Introduce assert_stalld_rejects() helpertests/functional/test_affinity.sh tests/functional/test_boost_duration.sh tests/functional/test_boost_period.sh +5 more+33 -1380 replies
9/23tests: Fix boost verification in runtime and duration teststests/functional/test_boost_duration.sh tests/functional/test_boost_runtime.sh+24 -240 replies
10/23tests: Fix subshell swallowing test resultstests/functional/test_starvation_detection.sh+15 -200 replies
11/23tests: Fix repeated log match finding same linetests/functional/test_fifo_priority_starvation.sh tests/helpers/test_helpers.sh+23 -80 replies
12/23chore: Remove legacy test infrastructure and stale docs.claude/CLAUDE.md .claude/agents/agent-prompt-engineer.md .claude/agents/c-expert.md +24 more+12 -73050 replies
13/23tests: Add assertions to SCHED_OTHER restoration testtests/functional/test_boost_restoration.sh+32 -50 replies
14/23tests: Fix CPU selection grep substring matchestests/functional/test_cpu_selection.sh+13 -90 replies
15/23tests: Add idle CPU skipping assertiontests/functional/test_idle_detection.sh+17 -150 replies
16/23tests: Remove redundant pkill from cleanuptests/helpers/test_helpers.sh+0 -40 replies
17/23tests: Introduce and adopt assert_log_contains() helpertests/functional/test_backend_selection.sh tests/functional/test_deadline_boosting.sh tests/functional/test_fifo_boosting.sh +8 more+66 -1490 replies
18/23tests: Remove weak, redundant, and assertion-free test blockstests/functional/test_affinity.sh tests/functional/test_boost_period.sh tests/functional/test_boost_restoration.sh +7 more+29 -10450 replies
19/23tests: Introduce and adopt assert_success() helpertests/functional/test_affinity.sh tests/functional/test_boost_restoration.sh tests/functional/test_cpu_selection.sh +7 more+71 -1730 replies
20/23tests: Replace wait conditionals with assertstests/functional/test_deadline_boosting.sh tests/functional/test_fifo_boosting.sh tests/functional/test_fifo_priority_starvation.sh +1 more+10 -460 replies
21/23tests: Remove if-wrappers around assert callstests/functional/test_foreground.sh tests/functional/test_logging_destinations.sh tests/functional/test_pidfile.sh +1 more+29 -730 replies
22/23tests: Abort immediately on test failuretests/helpers/test_helpers.sh+11 -300 replies
23/23tests: Remove dead code after making fail() fataltests/functional/test_affinity.sh tests/functional/test_backend_selection.sh tests/functional/test_boost_duration.sh +13 more+0 -840 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [stalld PATCH 00/23] tests: Comprehensive suite hardening and fail-fast

The stalld functional test suite has accumulated significant reliability and maintainability issues over time. Several tests were silently passing due to missing assertions, shell scoping bugs that discarded subshell results, and grep substring matches causing false positives on multi-digit CPU systems. Additionally, massive boilerplate duplication existed across the suite, and a daemon bug was discovered where --force_fifo combined with single-threaded mode silently fell back to adaptive mode instead of erroring out.

This series addresses these issues by overhauling the test validation logic and execution flow. It fixes the daemon's --force_fifo fallback behavior and introduces eight shared test helpers to eliminate duplicated validation patterns. The existing tests are then refactored to utilize these helpers, flattening conditional blocks and replacing verbose wait loops. Finally, the suite is transitioned to fail-fast semantics, where any failure immediately aborts the test run to provide immediate feedback.

As a result, approximately seven silently passing tests now correctly validate daemon behavior. The introduction of shared helpers and the removal of legacy C unit test infrastructure, stale documentation, and unreachable cleanup code yields a net reduction of roughly 9,700 lines (+626/-10325).

Wander Lairson Costa (23):
stalld: Reject --force_fifo in single-threaded mode
tests: Introduce test_section() helper
tests: Introduce cleanup_scenario() helper
tests: Introduce starvation and boost asserts
tests: Introduce find_starved_child() helper
tests: Fix task exit timing in test_boost_restoration
tests: Consolidate and adopt init_functional_test()
tests: Introduce assert_stalld_rejects() helper
tests: Fix boost verification in runtime and duration tests
tests: Fix subshell swallowing test results
tests: Fix repeated log match finding same line
chore: Remove legacy test infrastructure and stale docs
tests: Add assertions to SCHED_OTHER restoration test
tests: Fix CPU selection grep substring matches
tests: Add idle CPU skipping assertion
tests: Remove redundant pkill from cleanup
tests: Introduce and adopt assert_log_contains() helper
tests: Remove weak, redundant, and assertion-free test blocks
tests: Introduce and adopt assert_success() helper
tests: Replace wait conditionals with asserts
tests: Remove if-wrappers around assert calls
tests: Abort immediately on test failure
tests: Remove dead code after making fail() fatal

 .claude/CLAUDE.md                             |  585 ---------
 .claude/agents/agent-prompt-engineer.md       |  135 --
 .claude/agents/c-expert.md                    |   53 -
 .claude/agents/code-reviewer.md               |  104 --
 .claude/agents/get-agent-hash                 |   99 --
 .claude/agents/git-scm-master.md              | 1154 -----------------
 .claude/agents/kernel-hacker.md               |  231 ----
 .claude/agents/plan-validator.md              |  130 --
 .claude/agents/project-historian.md           |  285 ----
 .claude/agents/project-librarian.md           |  604 ---------
 .claude/agents/project-manager.md             |  388 ------
 .claude/agents/project-scope-guardian.md      |  326 -----
 .claude/agents/python-expert.md               |   57 -
 .claude/agents/test-specialist.md             |  656 ----------
 .claude/agents/update-agent-hashes            |   96 --
 .claude/context-snapshot.json                 |  103 --
 .claude/rules                                 |   42 -
 .gitignore                                    |    5 +-
 src/utils.c                                   |    9 +-
 tests/BACKEND_USAGE.md                        |  269 ----
 tests/CONTEXT_SNAPSHOT_2025-10-31.md          |  231 ----
 tests/Makefile                                |   29 +-
 tests/README.md                               |   29 +-
 tests/TODO.md                                 |  727 -----------
 tests/functional/test_affinity.sh             |  154 +--
 tests/functional/test_backend_selection.sh    |   24 +-
 tests/functional/test_boost_duration.sh       |  160 +--
 tests/functional/test_boost_period.sh         |  151 +--
 tests/functional/test_boost_restoration.sh    |  306 +----
 tests/functional/test_boost_runtime.sh        |  179 +--
 tests/functional/test_cpu_selection.sh        |   76 +-
 tests/functional/test_deadline_boosting.sh    |  256 +---
 tests/functional/test_fifo_boosting.sh        |  263 +---
 .../test_fifo_priority_starvation.sh          |  188 +--
 tests/functional/test_force_fifo.sh           |  196 +--
 tests/functional/test_foreground.sh           |   58 +-
 tests/functional/test_idle_detection.sh       |  195 +--
 tests/functional/test_log_only.sh             |   26 +-
 tests/functional/test_logging_destinations.sh |   37 +-
 tests/functional/test_pidfile.sh              |  151 +--
 tests/functional/test_runqueue_parsing.sh     |  417 ------
 tests/functional/test_starvation_detection.sh |  276 +---
 tests/functional/test_starvation_threshold.sh |  133 +-
 tests/functional/test_task_merging.sh         |  146 +--
 tests/helpers/test_helpers.sh                 |  233 +++-
 tests/legacy/README.md                        |  169 ---
 tests/legacy/test01.c                         |  506 --------
 tests/legacy/test01_wrapper.sh                |  161 ---
 tests/run_tests.sh                            |  143 +-
 49 files changed, 626 insertions(+), 10325 deletions(-)
 delete mode 100644 .claude/CLAUDE.md
 delete mode 100644 .claude/agents/agent-prompt-engineer.md
 delete mode 100644 .claude/agents/c-expert.md
 delete mode 100644 .claude/agents/code-reviewer.md
 delete mode 100755 .claude/agents/get-agent-hash
 delete mode 100644 .claude/agents/git-scm-master.md
 delete mode 100644 .claude/agents/kernel-hacker.md
 delete mode 100644 .claude/agents/plan-validator.md
 delete mode 100644 .claude/agents/project-historian.md
 delete mode 100644 .claude/agents/project-librarian.md
 delete mode 100644 .claude/agents/project-manager.md
 delete mode 100644 .claude/agents/project-scope-guardian.md
 delete mode 100644 .claude/agents/python-expert.md
 delete mode 100644 .claude/agents/test-specialist.md
 delete mode 100755 .claude/agents/update-agent-hashes
 delete mode 100644 .claude/context-snapshot.json
 delete mode 100644 .claude/rules
 delete mode 100644 tests/BACKEND_USAGE.md
 delete mode 100644 tests/CONTEXT_SNAPSHOT_2025-10-31.md
 delete mode 100644 tests/TODO.md
 delete mode 100755 tests/functional/test_runqueue_parsing.sh
 delete mode 100644 tests/legacy/README.md
 delete mode 100644 tests/legacy/test01.c
 delete mode 100755 tests/legacy/test01_wrapper.sh
Signature · 1 line
2.53.0