diff options
author | Martin Zumsande <mzumsande@gmail.com> | 2023-05-30 14:11:37 -0400 |
---|---|---|
committer | Martin Zumsande <mzumsande@gmail.com> | 2023-05-30 14:17:17 -0400 |
commit | 9fe9074266c6d7ddb40384d81741df1fc94980ff (patch) | |
tree | 9e92b4478a9eb6e5e0d771607684e96f35c28e3a /test/functional | |
parent | 71300489af362c3fed4736de6bffab4d758b6a84 (diff) |
test: add block sync to getblockfrompeer.py
This fixes an intermittent error, caused by blocks arriving
out of order due to how compact block relay may revert to headers
processing when the tip hasn't caught up, and resulting in slightly
different pruning behavior.
Making sure that all blocks from the previous tests are synced before
generating more blocks makes this impossible.
See Issue #27749 for more details.
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/rpc_getblockfrompeer.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/rpc_getblockfrompeer.py b/test/functional/rpc_getblockfrompeer.py index 2f093bebff..1ab1023cf1 100755 --- a/test/functional/rpc_getblockfrompeer.py +++ b/test/functional/rpc_getblockfrompeer.py @@ -117,9 +117,11 @@ class GetBlockFromPeerTest(BitcoinTestFramework): assert_raises_rpc_error(-1, error_msg, self.nodes[1].getblockfrompeer, blockhash, node1_interface_id) self.log.info("Connect pruned node") - # We need to generate more blocks to be able to prune self.connect_nodes(0, 2) pruned_node = self.nodes[2] + self.sync_blocks([self.nodes[0], pruned_node]) + + # We need to generate more blocks to be able to prune self.generate(self.nodes[0], 400, sync_fun=self.no_op) self.sync_blocks([self.nodes[0], pruned_node]) pruneheight = pruned_node.pruneblockchain(300) |