Skip to content

Commit 6548ba6

Browse files
committed
test: fix intermittent errors in p2p_ibd_stalling.py
Using is_connected instead of num_test_p2p_connections ensures that python has taken notice that the p2p was disconnected.
1 parent 9a28843 commit 6548ba6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/p2p_ibd_stalling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def run_test(self):
115115

116116
self.mocktime += 2
117117
node.setmocktime(self.mocktime)
118-
self.wait_until(lambda: node.num_test_p2p_connections() == NUM_PEERS - 2)
118+
self.wait_until(lambda: sum(x.is_connected for x in node.p2ps) == NUM_PEERS - 2)
119119
self.wait_until(lambda: self.is_block_requested(peers, stall_block))
120120
self.all_sync_send_with_ping(peers)
121121

@@ -128,7 +128,7 @@ def run_test(self):
128128

129129
self.mocktime += 2
130130
node.setmocktime(self.mocktime)
131-
self.wait_until(lambda: node.num_test_p2p_connections() == NUM_PEERS - 3)
131+
self.wait_until(lambda: sum(x.is_connected for x in node.p2ps) == NUM_PEERS - 3)
132132
self.wait_until(lambda: self.is_block_requested(peers, stall_block))
133133
self.all_sync_send_with_ping(peers)
134134

0 commit comments

Comments
 (0)