From 41a84a063719b34405e28b9759aaf1acc980a26e Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 3 Dec 2020 10:09:23 +0100 Subject: [PATCH] Merge #20466: test: Fix intermittent p2p_fingerprint issue fad7be584ffaf8099cc099d9378ba831c9483260 test: Fix intermittent p2p_finerprint issue (MarcoFalke) Pull request description: A single sync_with_ping can't be used to drop a block announcement, as the block might be sent *after* the ping has been responded to. Fix that by waiting for the block. ACKs for top commit: theStack: ACK fad7be584ffaf8099cc099d9378ba831c9483260 Tree-SHA512: d43ba9d07273486858f65a26326cc6637ef743bf7b400e5048ba7eac266fb1893283e6503dd49f179caa1abab2977315fb70ba9fba34be9a817a74259d8e4034 --- test/functional/p2p_fingerprint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/p2p_fingerprint.py b/test/functional/p2p_fingerprint.py index 9a64d2027d75a1..595f53d6972a00 100755 --- a/test/functional/p2p_fingerprint.py +++ b/test/functional/p2p_fingerprint.py @@ -118,7 +118,7 @@ def run_test(self): block_hash = int(tip, 16) self.send_block_request(block_hash, node0) self.send_header_request(block_hash, node0) - node0.sync_with_ping() + node0.wait_for_block(block_hash, timeout=3) # Request for very old stale block should now fail self.send_block_request(stale_hash, node0) @@ -144,5 +144,6 @@ def run_test(self): test_function = lambda: self.last_header_equals(block_hash, node0) wait_until(test_function, timeout=3) + if __name__ == '__main__': P2PFingerprintTest().main()