Skip to content

Commit fa310cc

Browse files
author
MarcoFalke
committed
test: Fix intermittent issue in p2p_orphan_handling.py
1 parent e568c1d commit fa310cc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

test/functional/p2p_orphan_handling.py

+1
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ def test_parents_change(self):
789789
# Disconnect peer1. peer2 should become the new candidate for orphan resolution.
790790
peer1.peer_disconnect()
791791
self.wait_until(lambda: node.num_test_p2p_connections() == 1)
792+
peer2.sync_with_ping() # Sync with the 'net' thread which completes the disconnection fully
792793
node.bumpmocktime(TXREQUEST_TIME_SKIP)
793794
self.wait_until(lambda: len(node.getorphantxs(verbosity=2)[0]["from"]) == 1)
794795
# Both parents should be requested, now that they are both missing.

test/functional/test_framework/test_node.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,8 @@ def num_test_p2p_connections(self):
827827

828828
def disconnect_p2ps(self):
829829
"""Close all p2p connections to the node.
830-
Use only after each p2p has sent a version message to ensure the wait works."""
830+
The state of the peers (such as txrequests) may not be fully cleared
831+
yet, even after this method returns."""
831832
for p in self.p2ps:
832833
p.peer_disconnect()
833834
del self.p2ps[:]

0 commit comments

Comments
 (0)