diff options
author | stratospher <44024636+stratospher@users.noreply.github.com> | 2024-02-29 10:39:40 +0530 |
---|---|---|
committer | stratospher <44024636+stratospher@users.noreply.github.com> | 2024-02-29 11:03:36 +0530 |
commit | 0487f91a2046c0d6f91ccaedeb00fbefa635c66d (patch) | |
tree | 8d26ae20d8ce66567e34ef81030ace4be737e44d /test/functional | |
parent | ba907f96ad37c09c49c0e1532fad118fcb8dd4a8 (diff) | |
download | bitcoin-0487f91a2046c0d6f91ccaedeb00fbefa635c66d.tar.xz |
test: Fix intermittent failure in rpc_net.py --v2transport
Make sure that v2 handshake is complete before comparing getpeerinfo
outputs so that `transport_protocol_type` isn't stuck at 'detecting'.
- on the python side, this is ensured by default
`wait_for_handshake = True` inside `add_p2p_connection()`.
- on the c++ side, add a wait_until statement till
`transport_protocol_type = v2` so that v2 handshake is complete.
Co-Authored-By: Martin Zumsande <mzumsande@gmail.com>
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/rpc_net.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index b4a58df5b2..accb2439f2 100755 --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -113,6 +113,8 @@ class NetTest(BitcoinTestFramework): self.nodes[0].setmocktime(no_version_peer_conntime) with self.nodes[0].wait_for_new_peer(): no_version_peer = self.nodes[0].add_p2p_connection(P2PInterface(), send_version=False, wait_for_verack=False) + if self.options.v2transport: + self.wait_until(lambda: self.nodes[0].getpeerinfo()[no_version_peer_id]["transport_protocol_type"] == "v2") self.nodes[0].setmocktime(0) peer_info = self.nodes[0].getpeerinfo()[no_version_peer_id] peer_info.pop("addr") |