Skip to content

Commit faac67c

Browse files
author
MacroFake
committed
test: Fix intermittent race in p2p_unrequested_blocks.py
1 parent 25dd4d8 commit faac67c

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

test/functional/p2p_unrequested_blocks.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,11 @@ def run_test(self):
257257
test_node.send_message(msg_block(block_291))
258258

259259
# At this point we've sent an obviously-bogus block, wait for full processing
260-
# without assuming whether we will be disconnected or not
261-
try:
262-
# Only wait a short while so the test doesn't take forever if we do get
263-
# disconnected
264-
test_node.sync_with_ping(timeout=1)
265-
except AssertionError:
266-
test_node.wait_for_disconnect()
267-
268-
self.nodes[0].disconnect_p2ps()
269-
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
260+
# and assume disconnection
261+
test_node.wait_for_disconnect()
262+
263+
self.nodes[0].disconnect_p2ps()
264+
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
270265

271266
# We should have failed reorg and switched back to 290 (but have block 291)
272267
assert_equal(self.nodes[0].getblockcount(), 290)

0 commit comments

Comments
 (0)