Merge bitcoin/bitcoin#32148: test: fix intermittent timeout in p2p_ibd_stalling.py

9f35d4d070 test: fix intermittent timeout in p2p_ibd_stalling.py (Martin Zumsande)

Pull request description:

  After sending the headers message add a sync, so that we wait until the header message from the previous peer has been received before connecting additional peers.
  In the failed NetBSD run linked in #32090, the second node managed to complete the handshake and send its own headers message before the message from the first node was received.

  Fixes #32090

ACKs for top commit:
  maflcko:
    lgtm ACK 9f35d4d070

Tree-SHA512: 30a98c6ec04f819c892ab5ce76a309df81b3a4644be021f938eefddbd00ec4141e055c3cf735c9e04ce2fe9e950470a99d54cb6be43230110348a802a6a6c252
This commit is contained in:
merge-script 2025-03-27 15:42:18 +08:00
commit 5dd6ebc7e1
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -78,7 +78,7 @@ class P2PIBDStallingTest(BitcoinTestFramework):
for id in range(NUM_PEERS): for id in range(NUM_PEERS):
peers.append(node.add_outbound_p2p_connection(P2PStaller(stall_block), p2p_idx=id, connection_type="outbound-full-relay")) peers.append(node.add_outbound_p2p_connection(P2PStaller(stall_block), p2p_idx=id, connection_type="outbound-full-relay"))
peers[-1].block_store = block_dict peers[-1].block_store = block_dict
peers[-1].send_without_ping(headers_message) peers[-1].send_and_ping(headers_message)
# Need to wait until 1023 blocks are received - the magic total bytes number is a workaround in lack of an rpc # Need to wait until 1023 blocks are received - the magic total bytes number is a workaround in lack of an rpc
# returning the number of downloaded (but not connected) blocks. # returning the number of downloaded (but not connected) blocks.