diff options
author | MacroFake <falke.marco@gmail.com> | 2022-05-13 09:31:04 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-05-13 09:15:12 +0200 |
commit | faac67cab02a755b0ce67716c5e5889432b13b83 (patch) | |
tree | c9843272d83f14b892214b8607e03ca6b090a1d8 /test/functional/p2p_unrequested_blocks.py | |
parent | 25dd4d85136c286adf7eca60df89a28d43b313b2 (diff) | |
download | bitcoin-faac67cab02a755b0ce67716c5e5889432b13b83.tar.xz |
test: Fix intermittent race in p2p_unrequested_blocks.py
Diffstat (limited to 'test/functional/p2p_unrequested_blocks.py')
-rwxr-xr-x | test/functional/p2p_unrequested_blocks.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/test/functional/p2p_unrequested_blocks.py b/test/functional/p2p_unrequested_blocks.py index 9c4e1dd1b1..76d9b045ce 100755 --- a/test/functional/p2p_unrequested_blocks.py +++ b/test/functional/p2p_unrequested_blocks.py @@ -257,16 +257,11 @@ class AcceptBlockTest(BitcoinTestFramework): test_node.send_message(msg_block(block_291)) # At this point we've sent an obviously-bogus block, wait for full processing - # without assuming whether we will be disconnected or not - try: - # 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() - test_node = self.nodes[0].add_p2p_connection(P2PInterface()) + # and assume disconnection + test_node.wait_for_disconnect() + + self.nodes[0].disconnect_p2ps() + test_node = self.nodes[0].add_p2p_connection(P2PInterface()) # We should have failed reorg and switched back to 290 (but have block 291) assert_equal(self.nodes[0].getblockcount(), 290) |