diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-05-08 19:31:13 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-05-08 19:31:17 -0400 |
commit | 376294cde6b1588cb17055d8fde567eaf5848c3c (patch) | |
tree | 959b90defd0133f76748529bba94485e9ac8c981 /test/functional/test_framework | |
parent | b55866969e248cbd912a1c298e3ba375685575dc (diff) | |
parent | fae153b40968bfd974a4709bcd841a59447abf18 (diff) | |
download | bitcoin-376294cde6b1588cb17055d8fde567eaf5848c3c.tar.xz |
Merge #18866: test: Fix verack race to avoid intermittent test failures
fae153b40968bfd974a4709bcd841a59447abf18 test: Fix verack race to avoid intermittent test failures (MarcoFalke)
Pull request description:
Fixes #18832
ACKs for top commit:
laanwj:
ACK fae153b40968bfd974a4709bcd841a59447abf18
Tree-SHA512: 071de8c8e2b2787c9433c7460e18b9a54beaf471a52ce848c5ac7263fc2a40f5b976d4f558ecc494fd0fa07284b7c98d29267cade58f80ab74fe9a7d18d94298
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r-- | test/functional/test_framework/util.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 20ab9ee464..7466a3cab3 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -399,7 +399,11 @@ def connect_nodes(from_connection, node_num): from_connection.addnode(ip_port, "onetry") # poll until version handshake complete to avoid race conditions # with transaction relaying - wait_until(lambda: all(peer['version'] != 0 for peer in from_connection.getpeerinfo())) + # See comments in net_processing: + # * Must have a version message before anything else + # * Must have a verack message before anything else + wait_until(lambda: all(peer['version'] != 0 for peer in from_connection.getpeerinfo())) + wait_until(lambda: all(peer['bytesrecv_per_msg'].pop('verack', 0) == 24 for peer in from_connection.getpeerinfo())) def sync_blocks(rpc_connections, *, wait=1, timeout=60): |