From 0487f91a2046c0d6f91ccaedeb00fbefa635c66d Mon Sep 17 00:00:00 2001 From: stratospher <44024636+stratospher@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:39:40 +0530 Subject: [PATCH] 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 --- test/functional/rpc_net.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index b4a58df5b2e..accb2439f25 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")