Skip to content

test: name cases that only share a fixture - #916

Merged
reardencode merged 4 commits into
masterfrom
test/named-fixtures
Oct 5, 2026
Merged

reardencode merged 4 commits into
masterfrom
test/named-fixtures

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Distinct cases that only share a costly chain are separate named tests. Rust's libtest has no beforeAll / afterAll, so the chain is built once in a OnceLock and each test takes a private copy, or a fresh mempool on a query it does not modify. A later beat that observes an earlier beat stays one test. A test whose body only calls other tests is neither shape.

Follows #915. That PR was right about the cost of one maturity connect and wrong about folding independent cases into one name.

  • SV2 listener and IBD cases are named again on the shared regtest pad. The send-buffer pin is keyed by listener address, so a parallel accept keeps autotune.
  • The tx_relay mempool cases are named on the 3-coinbase and 12-coinbase pads. get_coin_skips_block_tx_fks_and_mtp_without_time_lock copies the store before it connects.
  • Four Electrum protocol tests copy one height-101 pad.

Test plan

  • cargo test -p rbitcoin-sv2 --lib — 20 passed, 6.02s local
  • cargo test -p rbitcoin-net --lib — 661 passed, 91.76s local
  • cargo test -p rbitcoin-test --test electrum_protocol — 12 passed, 4.16s local
  • clippy -D warnings on rbitcoin-sv2, rbitcoin-net, and the electrum protocol test

rearden-grok Bot added 4 commits October 4, 2026 21:10
A later beat that sees an earlier beat stays one test. Cases that only
share a costly chain stay named, on one OnceLock pad, each with a private
copy. A test whose body is a call list of other tests is neither.
Each case already copies the OnceLock regtest pad, so restoring the
seven listener names and the two IBD names does not reconnect the
chain. The send-buffer pin is keyed by listener address so a parallel
accept keeps autotune.
The 3-coinbase and 12-coinbase connects stay process fixtures. Each
mempool case is its own test on a private pool. The coinbase connect
copies the store so it does not move the shared tip.
Four protocol tests each connected a height-101 chain before mining on
a private store. They now copy one process pad, and each test keeps its
own name.
@reardencode
reardencode merged commit 1668747 into master Oct 5, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant