mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 05:57:59 +01:00
test: fix intermittent failure in p2p_compactblocks_hb.py
As a result of node1 receiving a block, it sends out SENDCMPCT messages to its peers to update the status. We need to wait until those are received and processed by the peers to avoid intermittent failures.
This commit is contained in:
@@ -32,10 +32,15 @@ class CompactBlocksConnectionTest(BitcoinTestFramework):
|
||||
self.connect_nodes(peer, 0)
|
||||
self.generate(self.nodes[0], 1)
|
||||
self.disconnect_nodes(peer, 0)
|
||||
status_to = [self.peer_info(1, i)['bip152_hb_to'] for i in range(2, 6)]
|
||||
status_from = [self.peer_info(i, 1)['bip152_hb_from'] for i in range(2, 6)]
|
||||
assert_equal(status_to, status_from)
|
||||
return status_to
|
||||
|
||||
def status_to():
|
||||
return [self.peer_info(1, i)['bip152_hb_to'] for i in range(2, 6)]
|
||||
|
||||
def status_from():
|
||||
return [self.peer_info(i, 1)['bip152_hb_from'] for i in range(2, 6)]
|
||||
|
||||
self.wait_until(lambda: status_to() == status_from())
|
||||
return status_to()
|
||||
|
||||
def run_test(self):
|
||||
self.log.info("Testing reserved high-bandwidth mode slot for outbound peer...")
|
||||
|
||||
Reference in New Issue
Block a user