aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-02-29 13:06:24 -0500
committerAva Chow <github@achow101.com>2024-02-29 13:15:51 -0500
commit61aa981b8c40eda39fbab8c7cd105c236b0f33bd (patch)
tree174bdb113f339c6d54d57e5d53ce96955a3e302c /test
parent2649e655b9203d6d08cb1a26fa4846f2c403b297 (diff)
parent0487f91a2046c0d6f91ccaedeb00fbefa635c66d (diff)
Merge bitcoin/bitcoin#29511: test: Fix intermittent failure in rpc_net.py --v2transport
0487f91a2046c0d6f91ccaedeb00fbefa635c66d test: Fix intermittent failure in rpc_net.py --v2transport (stratospher) Pull request description: Fixes #29508. Make sure that v2 handshake is complete before comparing getpeerinfo outputs so that `transport_protocol_type` isn't stuck at 'detecting'. This is done by adding a wait_until statement till `transport_protocol_type = v2` so that bitcoind waits until the v2 handshake is complete. (on the python side, this is ensured by default since `wait_for_handshake = True` inside `add_p2p_connection()`) ACKs for top commit: Sjors: ACK 0487f91a2046c0d6f91ccaedeb00fbefa635c66d mzumsande: Code Review ACK 0487f91a2046c0d6f91ccaedeb00fbefa635c66d achow101: ACK 0487f91a2046c0d6f91ccaedeb00fbefa635c66d vasild: ACK 0487f91a2046c0d6f91ccaedeb00fbefa635c66d Tree-SHA512: 44dd646a61cd38da243f527df7321e22d1821c2b090be43673027746098caf450c6671708ed731ba257952df6b5886e64c9c2f9686a82f6ef0f25780b7a87d3d
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_net.py2
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")