#35139 test: Add thread-safe fast-failing test macros

ReviewabilityReviewsAgreementSize
#35139 maflcko test: Add thread-safe fast-failing test macrosAuthor silent 73d0Positive0 + 337 tests
  • Add thread-safe and fail-fast test assertion macros that can be reused across unit and fuzz tests
  • Catch mixed-signedness comparisons at compile time and reduce cascading failure log noise in CI
  • Ready for review
  • Concept approval without stated reasons (sedited)
  • Withdrew concern about losing debug context after CI log truncation examples were shown (sedited)
  • 0 lines added or modified outside tests
  • 337 lines added or modified in tests
  • 162 lines removed in total
  • 4 files, 4 commits
Test infrastructure#16 of 54
P3 · cleanup
  • P3 because this improves test infrastructure with thread safety under TSAN and compile-time checks
  • Modernizes assertions and reduces CI log noise rather than fixing an urgent failure
  • Ranking pass: Placed below the fuzz-throughput and signal fixes; it is framework capability whose payoff mostly lands with the Boost-runner migration.
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:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
sedited (member)objection, approachlosing context when debugging and being unable to see all failing cases at once when patching testsaccepted · v1, not yet re-checkedansweredyes2026-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

dossier JSON · extract JSON · model ledger, generated 2026-09-18T03:28, confidence high, input hash d6fb29496dabd952
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