#35139 test: Add thread-safe fast-failing test macros
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #35139 test: Add thread-safe fast-failing test macros | Author silent 73d | 0 | Positive | 0 + 337 tests | |||
|
|
|
|
| |||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | |||||||
Goal
Adds lightweight, thread-safe, and fail-fast test assertion macros (`ASSERT`, `ASSERT_EQ`, `ASSERT_EQ_COLLECTIONS`, `ASSERT_EXCEPTION`) in `src/test/util/common.h` as drop-in replacements for Boost test macros. It enforces signedness matching at compile time and demonstrates the new macros by converting `src/test/streams_tests.cpp`.
Problem: Boost check macros are tied to the Boost test framework and cannot be reused in fuzz tests. They also lack thread safety under TSAN, silently permit invalid mixed-signedness comparisons, and continue running after failures, generating excessive log noise that obscures the original error in CI.
Reviewability
Stale · Author silent 73d
No author activity for 73 days; a review may wait a long time for a response.
Agreement
Positive
support without stated reasons, no open objection (sedited)
Thread notes: sedited questioned the fast-failing approach, but withdrew the concern by giving Concept ACK after maflcko gave examples of log truncation in CI.
Objections, suggestions, and questions:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| sedited (member) | objection, approach | losing context when debugging and being unable to see all failing cases at once when patching tests | accepted · v1, not yet re-checked | answered | yes | 2026-05-26: 'I've found it useful in the past that the tests are not failing fast. Both to have more context when debugging, and to see all failing cases at once when patching them.' Status from: 2026-07-07: sedited: 'Concept ACK' |
Support:
- sedited (member) (Concept ACK, 2026-07-07): Concept ACK [not substantive]
Participants:
- mercie-ux (none, neutral, 1 statements 2026-04-27 to 2026-04-27): suggested removing unused include
- sedited (member, support, 2 statements 2026-05-26 to 2026-07-07): initially skeptical about fast-failing, later gave Concept ACK
Dependencies
Enables:
- #34666 tracking issue for test framework improvements
Files
499 lines under test/bench/ci.
- src/test/streams_tests.cpp +155/-161
- src/test/util/common.h +176/-1
- src/test/util/common.cpp +5/-0
- src/test/util/CMakeLists.txt +1/-0
Card
The short text the ranking pass compares across PRs.
This PR introduces custom assertion macros (ASSERT, ASSERT_EQ, and related helpers) in test utilities to replace Boost test macros. The new macros provide thread safety under TSAN, strict signedness comparison checks, and fail-fast behavior on failure to prevent CI log bloat, while enabling test assertions to be shared with fuzz tests. It converts streams_tests.cpp to demonstrate the replacements. Review is ready and sedited gave Concept ACK after initial questions about fail-fast behavior were resolved.
Data
thread read through 2026-07-07 (9 statements), head 30702cc5f1
Discussion read under schema 1 rules: suggestions and questions may be missing, and an objection may combine several harms (schema history).
labels: Tests · draft
Categories
Test infrastructure
P3 · cleanup (ranking pass: Placed below the fuzz-throughput and signal fixes; it is framework capability whose payoff mostly lands with the Boost-runner migration.)
Improves unit test infrastructure by introducing thread-safe, fail-fast assertion macros reusable in fuzz tests and catching signedness mismatches at compile time. Boost test macros currently lack thread safety under TSAN and obscure errors with cascaded failures in CI, but replacing them is standard modernization rather than fixing an urgent CI failure.
Membership: Adds shared assertion macros in `src/test/util/common.h` for use across unit and fuzz tests, bearing the Tests label.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 1