From 02942056fd861581503a8a35a06dcf22d4ba1473 Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Thu, 13 Mar 2025 17:58:59 -0400 Subject: [PATCH] test: fix intermittent failure in p2p_orphan_handling.py If we bump the mocktime before the node has successfully disconnected the peer, the requests for both parents could be spread over two GETDATAS, which would make the test fail. --- test/functional/p2p_orphan_handling.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/p2p_orphan_handling.py b/test/functional/p2p_orphan_handling.py index 370caad8800..d74a866ae5a 100755 --- a/test/functional/p2p_orphan_handling.py +++ b/test/functional/p2p_orphan_handling.py @@ -788,6 +788,7 @@ class OrphanHandlingTest(BitcoinTestFramework): # Disconnect peer1. peer2 should become the new candidate for orphan resolution. peer1.peer_disconnect() + self.wait_until(lambda: node.num_test_p2p_connections() == 1) node.bumpmocktime(TXREQUEST_TIME_SKIP) self.wait_until(lambda: len(node.getorphantxs(verbosity=2)[0]["from"]) == 1) # Both parents should be requested, now that they are both missing.