Skip to content

Commit e19d72f

Browse files
MarcoFalkepanleone
authored andcommitted
Merge bitcoin#18866: test: Fix verack race to avoid intermittent test failures
fae153b test: Fix verack race to avoid intermittent test failures (MarcoFalke) Pull request description: Fixes bitcoin#18832 ACKs for top commit: laanwj: ACK fae153b Tree-SHA512: 071de8c8e2b2787c9433c7460e18b9a54beaf471a52ce848c5ac7263fc2a40f5b976d4f558ecc494fd0fa07284b7c98d29267cade58f80ab74fe9a7d18d94298
1 parent a34f0d3 commit e19d72f

File tree

1 file changed

+5
-1
lines changed
  • test/functional/test_framework

1 file changed

+5
-1
lines changed

test/functional/test_framework/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,11 @@ def connect_nodes(from_connection, node_num):
382382
from_connection.addnode(ip_port, "onetry")
383383
# poll until version handshake complete to avoid race conditions
384384
# with transaction relaying
385-
wait_until(lambda: all(peer['version'] != 0 for peer in from_connection.getpeerinfo()))
385+
# See comments in net_processing:
386+
# * Must have a version message before anything else
387+
# * Must have a verack message before anything else
388+
wait_until(lambda: all(peer['version'] != 0 for peer in from_connection.getpeerinfo()))
389+
wait_until(lambda: all(peer['bytesrecv_per_msg'].pop('verack', 0) == 24 for peer in from_connection.getpeerinfo()))
386390

387391
def connect_nodes_clique(nodes):
388392
# max_workers should be the maximum number of nodes that we have in the same functional test,

0 commit comments

Comments
 (0)