Skip to content

Commit 376294c

Browse files
author
MarcoFalke
committed
Merge #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 #18832 ACKs for top commit: laanwj: ACK fae153b Tree-SHA512: 071de8c8e2b2787c9433c7460e18b9a54beaf471a52ce848c5ac7263fc2a40f5b976d4f558ecc494fd0fa07284b7c98d29267cade58f80ab74fe9a7d18d94298
2 parents b558669 + fae153b commit 376294c

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
@@ -399,7 +399,11 @@ def connect_nodes(from_connection, node_num):
399399
from_connection.addnode(ip_port, "onetry")
400400
# poll until version handshake complete to avoid race conditions
401401
# with transaction relaying
402-
wait_until(lambda: all(peer['version'] != 0 for peer in from_connection.getpeerinfo()))
402+
# See comments in net_processing:
403+
# * Must have a version message before anything else
404+
# * Must have a verack message before anything else
405+
wait_until(lambda: all(peer['version'] != 0 for peer in from_connection.getpeerinfo()))
406+
wait_until(lambda: all(peer['bytesrecv_per_msg'].pop('verack', 0) == 24 for peer in from_connection.getpeerinfo()))
403407

404408

405409
def sync_blocks(rpc_connections, *, wait=1, timeout=60):

0 commit comments

Comments
 (0)