Skip to content

Commit

Permalink
change to max of 10 iterations with early exit on success
Browse files Browse the repository at this point in the history
  • Loading branch information
delta1 committed Apr 9, 2024
1 parent afc822c commit 98ad8c1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/functional/feature_dbcrash.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ def run_test(self):
# Main test loop:
# each time through the loop, generate a bunch of transactions,
# and then either mine a single new block on the tip, or some-sized reorg.
# ELEMENTS: reduced iters to run in some "reasonable" amount of time (~6 hours)
for i in range(6):
# ELEMENTS: modified to only run until successfully testing a node crash on restart
# with a maximum of 10 iterations
i = 0
while self.crashed_on_restart < 1:
self.log.info(f"Iteration {i}, generating 2500 transactions {self.restart_counts}")
# Generate a bunch of small-ish transactions
self.generate_small_transactions(self.nodes[3], 2500, utxo_list)
Expand Down Expand Up @@ -270,6 +272,11 @@ def run_test(self):
utxo_list = self.nodes[3].listunspent()
self.log.debug(f"Node3 utxo count: {len(utxo_list)}")

if i >= 9:
raise AssertionError(f"10 iterations without node crash, this should not happen")
else:
i += 1

# Check that the utxo hashes agree with node3
# Useful side effect: each utxo cache gets flushed here, so that we
# won't get crashes on shutdown at the end of the test.
Expand Down

0 comments on commit 98ad8c1

Please sign in to comment.