Skip to content

Commit 80afa62

Browse files
committed
test: Fix intermittent issue in p2p_handshake.py
If we reuse the same port when disconnecting and establishing connections again, we might hit this scenario: - disconnection is done on python side for P2PConnection - disconnection is not complete on c++ side for TestNode - we're trying to establish a new connection on same port again Prevent this scenario from happening by ensuring disconnection on c++ side for TestNode as well.
1 parent c8e3978 commit 80afa62

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/functional/p2p_handshake.py

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def add_outbound_connection(self, node, connection_type, services, wait_for_disc
4141
peer.sync_with_ping()
4242
peer.peer_disconnect()
4343
peer.wait_for_disconnect()
44+
self.wait_until(lambda: len(node.getpeerinfo()) == 0)
4445

4546
def test_desirable_service_flags(self, node, service_flag_tests, desirable_service_flags, expect_disconnect):
4647
"""Check that connecting to a peer either fails or succeeds depending on its offered

0 commit comments

Comments
 (0)