Skip to content

Commit 681ce59

Browse files
author
MarcoFalke
committed
Merge #20466: test: Fix intermittent p2p_fingerprint issue
fad7be5 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 fad7be5 Tree-SHA512: d43ba9d07273486858f65a26326cc6637ef743bf7b400e5048ba7eac266fb1893283e6503dd49f179caa1abab2977315fb70ba9fba34be9a817a74259d8e4034
2 parents a35b948 + fad7be5 commit 681ce59

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/p2p_fingerprint.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ def run_test(self):
9898

9999
# Longest chain is extended so stale is much older than chain tip
100100
self.nodes[0].setmocktime(0)
101-
self.nodes[0].generatetoaddress(1, self.nodes[0].get_deterministic_priv_key().address)
101+
block_hash = int(self.nodes[0].generatetoaddress(1, self.nodes[0].get_deterministic_priv_key().address)[-1], 16)
102102
assert_equal(self.nodes[0].getblockcount(), 14)
103-
node0.sync_with_ping()
103+
node0.wait_for_block(block_hash, timeout=3)
104104

105105
# Request for very old stale block should now fail
106106
with p2p_lock:
@@ -128,5 +128,6 @@ def run_test(self):
128128
self.send_header_request(block_hash, node0)
129129
node0.wait_for_header(hex(block_hash), timeout=3)
130130

131+
131132
if __name__ == '__main__':
132133
P2PFingerprintTest().main()

0 commit comments

Comments
 (0)