test: fix intermittent timeout in p2p_ibd_stalling.py

by adding a sync, so that we wait until the header message from the
previous peer has been received before connecting additional peers.
This commit is contained in:
Martin Zumsande 2025-03-26 13:22:01 -04:00
parent c0b7159de4
commit 9f35d4d070

View file

@ -78,7 +78,7 @@ class P2PIBDStallingTest(BitcoinTestFramework):
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[-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
# returning the number of downloaded (but not connected) blocks.