Skip to content

Commit

Permalink
Merge bitcoin#20466: test: Fix intermittent p2p_fingerprint issue
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MarcoFalke authored and vijaydasmp committed Nov 7, 2023
1 parent ab56dcf commit 41a84a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/functional/p2p_fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()

0 comments on commit 41a84a0

Please sign in to comment.