Skip to content

Commit 36fabb0

Browse files
committed
Merge bitcoin/bitcoin#29041: test: fix intermittent error in rpc_net.py (#29030)
ea00f98 test: fix intermittent error in rpc_net.py (#29030) (Sebastian Falbesoner) Pull request description: Asserting for the debug log message "Added connection peer=" is insufficient for ensuring that this new connection will show up in a following getpeerinfo() call, as the debug message is written in the CNode ctor, which means it hasn't necessarily been added to CConnman.m_nodes at this point. Solve this by using the recently introduced `wait_for_new_peer` helper (see #29006, commit 00e0658), which is more robust. Fixes #29030. ACKs for top commit: maflcko: lgtm ACK ea00f98 Tree-SHA512: dda307949a466fb3b24408a8c213d307e0af2155f2e8b4e52c836a22397f9d218bf9d8c54ca55bae62a96d7566f27167db9311dd8801785c327234783af5ed00
2 parents 09ab9d4 + ea00f98 commit 36fabb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/functional/rpc_net.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_getpeerinfo(self):
111111
no_version_peer_id = 2
112112
no_version_peer_conntime = int(time.time())
113113
self.nodes[0].setmocktime(no_version_peer_conntime)
114-
with self.nodes[0].assert_debug_log([f"Added connection peer={no_version_peer_id}"]):
114+
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)
116116
self.nodes[0].setmocktime(0)
117117
peer_info = self.nodes[0].getpeerinfo()[no_version_peer_id]

0 commit comments

Comments
 (0)