mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
test: Fix intermittent race in p2p_unrequested_blocks.py
This commit is contained in:
parent
25dd4d8513
commit
faac67cab0
1 changed files with 4 additions and 9 deletions
|
@ -257,16 +257,11 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||||
test_node.send_message(msg_block(block_291))
|
test_node.send_message(msg_block(block_291))
|
||||||
|
|
||||||
# At this point we've sent an obviously-bogus block, wait for full processing
|
# At this point we've sent an obviously-bogus block, wait for full processing
|
||||||
# without assuming whether we will be disconnected or not
|
# and assume disconnection
|
||||||
try:
|
test_node.wait_for_disconnect()
|
||||||
# Only wait a short while so the test doesn't take forever if we do get
|
|
||||||
# disconnected
|
|
||||||
test_node.sync_with_ping(timeout=1)
|
|
||||||
except AssertionError:
|
|
||||||
test_node.wait_for_disconnect()
|
|
||||||
|
|
||||||
self.nodes[0].disconnect_p2ps()
|
self.nodes[0].disconnect_p2ps()
|
||||||
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
|
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
|
||||||
|
|
||||||
# We should have failed reorg and switched back to 290 (but have block 291)
|
# We should have failed reorg and switched back to 290 (but have block 291)
|
||||||
assert_equal(self.nodes[0].getblockcount(), 290)
|
assert_equal(self.nodes[0].getblockcount(), 290)
|
||||||
|
|
Loading…
Add table
Reference in a new issue