Repository navigation
test(shared): add post-IBD tip wait helper - #449
Conversation
| miner: &bitcoind::Client, | ||
| observer: &bitcoind::Client, |
There was a problem hiding this comment.
All callers currently pass the same client as miner and observer. Can simplify it for now.
| miner: &bitcoind::Client, | |
| observer: &bitcoind::Client, | |
| miner: &bitcoind::Client, |
There was a problem hiding this comment.
Absolutely. This change was originally motivated by seeing test_integration_logextractor_saw_new_header (https://github.com/peer-observer/peer-observer/pull/420/changes#diff-a50a41ef033e3a5a57ce05a9bce73f5551b216e71f7cf1315f15215963a235e3R700) in #420, where the two node variant would be useful, hence the two clients.
But happy to collapse to one for the current state of the codebase, and extend when #420 is in.
There was a problem hiding this comment.
I see! I wasn't aware of that.
8e915b4 to
0093b93
Compare
|
Addressed review feedback:
|
|
Looks good to me, thanks! |
…tests This commit is also a follow up of peer-observer#449 (comment)
…tests This commit is also a follow up of peer-observer#449 (comment)
…tests This commit is also a follow up of peer-observer#449 (comment)
…tests This commit is also a follow up of peer-observer#449 (comment)
…tests This commit is also a follow up of peer-observer#449 (comment)
…tests This commit is also a follow up of peer-observer#449 (comment)
…tests This commit is also a follow up of peer-observer#449 (comment)
…tests Follow up from: #449 (comment)
Summary
This came out of reviewing the compact block reconstruction integration tests in #420. Those tests need a deterministic way to know that a regtest node has connected a mined block and left IBD before the next step tries to trigger post-IBD behaviour.
This adds
shared::testing::node::mine_and_wait_for_tip, which mines one block on the given node, polls until that block is the active tip, verifiesinitial_block_downloadis false, and then drains the validation interface queue.The existing
p2p-extractoraddress-announcementandrpc-extractorgetorphantxstests both utilise the helper instead of generating a block and immediately asserting on IBD state. That should make the tests less sensitive to slow hardware (e.g. the hardware I actually use for testing, a VM on a 10yr old server!!) where bitcoind has not yet advanced all relevant state by the next line of test code.UPDATE: The helper currently takes a single client because both call sites here are single-node. When the cross-node case lands (PR #420's
test_integration_logextractor_saw_new_headeris the obvious next caller, wherenode2mines andnode1observes), the signature can grow to(miner, observer)or split into a dedicatedmine_and_wait_for_tip_observed_byhelper without disturbing the current callers.Testing
My usual stress: 50 consecutive runs of the integration suite on older hardware, all green.