Skip to content

Commit fa2aae5

Browse files
author
MacroFake
committed
test: Fix intermittent issue in p2p_leak.py
1 parent c89fabf commit fa2aae5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/functional/p2p_leak.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ def run_test(self):
138138
# Give the node enough time to possibly leak out a message
139139
time.sleep(PEER_TIMEOUT + 2)
140140

141+
self.log.info("Connect peer to ensure the net thread runs the disconnect logic at least once")
142+
self.nodes[0].add_p2p_connection(P2PInterface())
143+
141144
# Make sure only expected messages came in
142145
assert not no_version_idle_peer.unexpected_msg
143146
assert not no_version_idle_peer.got_wtxidrelay
@@ -169,7 +172,7 @@ def run_test(self):
169172

170173
self.log.info('Check that old peers are disconnected')
171174
p2p_old_peer = self.nodes[0].add_p2p_connection(P2PInterface(), send_version=False, wait_for_verack=False)
172-
with self.nodes[0].assert_debug_log(['peer=4 using obsolete version 31799; disconnecting']):
175+
with self.nodes[0].assert_debug_log(["using obsolete version 31799; disconnecting"]):
173176
p2p_old_peer.send_message(self.create_old_version(31799))
174177
p2p_old_peer.wait_for_disconnect()
175178

0 commit comments

Comments
 (0)