test: name cases that only share a fixture - #916
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 aOnceLockand 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.
get_coin_skips_block_tx_fks_and_mtp_without_time_lockcopies the store before it connects.Test plan
cargo test -p rbitcoin-sv2 --lib— 20 passed, 6.02s localcargo test -p rbitcoin-net --lib— 661 passed, 91.76s localcargo test -p rbitcoin-test --test electrum_protocol— 12 passed, 4.16s local-D warningsonrbitcoin-sv2,rbitcoin-net, and the electrum protocol test