aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-09-04 22:27:50 +0100
committerfanquake <fanquake@gmail.com>2022-09-04 22:32:22 +0100
commit0ebd4db32b39cb7c505148f090df4b7ac778c307 (patch)
tree31c47f528ad3d99a77bfeba2ff9e391b1c050463 /test
parentdf31e468b9adc21313d52e0c50211a653e98b3dc (diff)
parent88e7807e771a568ac34c320b4055d832990049df (diff)
downloadbitcoin-0ebd4db32b39cb7c505148f090df4b7ac778c307.tar.xz
Merge bitcoin/bitcoin#25978: test: fix non-determinism in p2p_headers_sync_with_minchainwork.py
88e7807e771a568ac34c320b4055d832990049df test: fix non-determinism in p2p_headers_sync_with_minchainwork.py (Suhas Daftuar) Pull request description: The test for node3's chaintips (added in PR25960) needs some sort of synchronization in order to be reliable. ACKs for top commit: mzumsande: Code Review ACK 88e7807e771a568ac34c320b4055d832990049df satsie: ACK 88e7807e771a568ac34c320b4055d832990049df Tree-SHA512: 5607c5b1a95d91e7cf81b695eb356b782cbb303bcc7fd9044e1058c0c0625c5f9e5fe4f4dde9d2bffa27a80d83fc060336720f7becbba505ccfb8a04fcc81705
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/p2p_headers_sync_with_minchainwork.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/p2p_headers_sync_with_minchainwork.py b/test/functional/p2p_headers_sync_with_minchainwork.py
index 016375222d..991e3348ed 100755
--- a/test/functional/p2p_headers_sync_with_minchainwork.py
+++ b/test/functional/p2p_headers_sync_with_minchainwork.py
@@ -49,7 +49,7 @@ class RejectLowDifficultyHeadersTest(BitcoinTestFramework):
def test_chains_sync_when_long_enough(self):
self.log.info("Generate blocks on the node with no required chainwork, and verify nodes 1 and 2 have no new headers in their headers tree")
- with self.nodes[1].assert_debug_log(expected_msgs=["[net] Ignoring low-work chain (height=14)"]), self.nodes[2].assert_debug_log(expected_msgs=["[net] Ignoring low-work chain (height=14)"]):
+ with self.nodes[1].assert_debug_log(expected_msgs=["[net] Ignoring low-work chain (height=14)"]), self.nodes[2].assert_debug_log(expected_msgs=["[net] Ignoring low-work chain (height=14)"]), self.nodes[3].assert_debug_log(expected_msgs=["Synchronizing blockheaders, height: 14"]):
self.generate(self.nodes[0], NODE1_BLOCKS_REQUIRED-1, sync_fun=self.no_op)
# Node3 should always allow headers due to noban permissions
@@ -78,7 +78,7 @@ class RejectLowDifficultyHeadersTest(BitcoinTestFramework):
} in chaintips
self.log.info("Generate more blocks to satisfy node1's minchainwork requirement, and verify node2 still has no new headers in headers tree")
- with self.nodes[2].assert_debug_log(expected_msgs=["[net] Ignoring low-work chain (height=15)"]):
+ with self.nodes[2].assert_debug_log(expected_msgs=["[net] Ignoring low-work chain (height=15)"]), self.nodes[3].assert_debug_log(expected_msgs=["Synchronizing blockheaders, height: 15"]):
self.generate(self.nodes[0], NODE1_BLOCKS_REQUIRED - self.nodes[0].getblockcount(), sync_fun=self.no_op)
self.sync_blocks(self.nodes[0:2]) # node3 will sync headers (noban permissions) but not blocks (due to minchainwork)