Skip to content

Commit

Permalink
test: Fix intermittent issue in p2p_segwit.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Apr 29, 2021
1 parent a7a1937 commit faecb72
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/functional/p2p_segwit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1966,9 +1966,10 @@ def test_upgrade_after_activation(self):
# Restarting node 2 should result in a shutdown because the blockchain consists of
# insufficiently validated blocks per segwit consensus rules.
self.stop_node(2)
with self.nodes[2].assert_debug_log(expected_msgs=[
f"Witness data for blocks after height {SEGWIT_HEIGHT} requires validation. Please restart with -reindex."], timeout=10):
self.nodes[2].start([f"-segwitheight={SEGWIT_HEIGHT}"])
self.nodes[2].assert_start_raises_init_error(
extra_args=[f"-segwitheight={SEGWIT_HEIGHT}"],
expected_msg=f": Witness data for blocks after height {SEGWIT_HEIGHT} requires validation. Please restart with -reindex..\nPlease restart with -reindex or -reindex-chainstate to recover.",
)

# As directed, the user restarts the node with -reindex
self.start_node(2, extra_args=["-reindex", f"-segwitheight={SEGWIT_HEIGHT}"])
Expand Down

0 comments on commit faecb72

Please sign in to comment.