Skip to content

Commit 61aa981

Browse files
committed
Merge bitcoin/bitcoin#29511: test: Fix intermittent failure in rpc_net.py --v2transport
0487f91 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 0487f91 mzumsande: Code Review ACK 0487f91 achow101: ACK 0487f91 vasild: ACK 0487f91 Tree-SHA512: 44dd646a61cd38da243f527df7321e22d1821c2b090be43673027746098caf450c6671708ed731ba257952df6b5886e64c9c2f9686a82f6ef0f25780b7a87d3d
2 parents 2649e65 + 0487f91 commit 61aa981

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/functional/rpc_net.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ def test_getpeerinfo(self):
113113
self.nodes[0].setmocktime(no_version_peer_conntime)
114114
with self.nodes[0].wait_for_new_peer():
115115
no_version_peer = self.nodes[0].add_p2p_connection(P2PInterface(), send_version=False, wait_for_verack=False)
116+
if self.options.v2transport:
117+
self.wait_until(lambda: self.nodes[0].getpeerinfo()[no_version_peer_id]["transport_protocol_type"] == "v2")
116118
self.nodes[0].setmocktime(0)
117119
peer_info = self.nodes[0].getpeerinfo()[no_version_peer_id]
118120
peer_info.pop("addr")

0 commit comments

Comments
 (0)