diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-02-25 14:32:42 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-02-25 14:32:46 +0100 |
commit | 1b1d8bde1c940345cad57b165dc6b5eaf9782857 (patch) | |
tree | 7cec67ccbab56bdf92ff71efeeddc23db1891893 /test | |
parent | 2059d32edbd0ac8e4534b00243385b9fc2a2f3a4 (diff) | |
parent | fa560cc6c493764efc2f2f1702d45286060fe15f (diff) | |
download | bitcoin-1b1d8bde1c940345cad57b165dc6b5eaf9782857.tar.xz |
Merge #21252: test: Add missing wait for sync to feature_blockfilterindex_prune
fa560cc6c493764efc2f2f1702d45286060fe15f test: Intermittent issue in feature_blockfilterindex_prune (MarcoFalke)
Pull request description:
https://cirrus-ci.com/task/4962244553342976?command=ci#L5131
The index is built in a background thread, so we have to wait for it.
ACKs for top commit:
jonatack:
ACK fa560cc6c493764efc2f2f1702d45286060fe15f
Tree-SHA512: e7a246fe43a28511581fe34b1f5a85303b1874b2535330afc0405269cce7306984ecc6af389791321e3aa4b224819e89d9b89dd5bc080d60baa20bd007412787
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/feature_blockfilterindex_prune.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/functional/feature_blockfilterindex_prune.py b/test/functional/feature_blockfilterindex_prune.py index 455073ef9c..6648e8ecd9 100755 --- a/test/functional/feature_blockfilterindex_prune.py +++ b/test/functional/feature_blockfilterindex_prune.py @@ -5,8 +5,9 @@ """Test blockfilterindex in conjunction with prune.""" from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( - assert_raises_rpc_error, + assert_equal, assert_greater_than, + assert_raises_rpc_error, ) @@ -16,17 +17,18 @@ class FeatureBlockfilterindexPruneTest(BitcoinTestFramework): self.extra_args = [["-fastprune", "-prune=1"], ["-fastprune", "-prune=1", "-blockfilterindex=1"]] def run_test(self): - # test basic pruning compatibility & filter access of pruned blocks self.log.info("check if we can access a blockfilter when pruning is enabled but no blocks are actually pruned") + self.wait_until(lambda: self.nodes[1].getindexinfo() == {'basic block filter index': {'synced': True, 'best_block_height': 200}}) assert len(self.nodes[1].getblockfilter(self.nodes[1].getbestblockhash())['filter']) > 0 # Mine two batches of blocks to avoid hitting NODE_NETWORK_LIMITED_MIN_BLOCKS disconnection self.nodes[1].generate(250) self.sync_all() self.nodes[1].generate(250) self.sync_all() + self.wait_until(lambda: self.nodes[1].getindexinfo() == {'basic block filter index': {'synced': True, 'best_block_height': 700}}) self.log.info("prune some blocks") pruneheight = self.nodes[1].pruneblockchain(400) - assert pruneheight != 0 + assert_equal(pruneheight, 250) self.log.info("check if we can access the tips blockfilter when we have pruned some blocks") assert len(self.nodes[1].getblockfilter(self.nodes[1].getbestblockhash())['filter']) > 0 self.log.info("check if we can access the blockfilter of a pruned block") |