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 8, 2024
1 parent afc822c commit 9dc2afe
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 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 @@ -285,9 +287,14 @@ def run_test(self):
assert self.crashed_on_restart > 0

# Warn if any of the nodes escaped restart.
for i in range(3):
if self.restart_counts[i] == 0:
self.log.warning(f"Node {i} never crashed during utxo flush!")
for j in range(3):
if self.restart_counts[j] == 0:
self.log.warning(f"Node {j} never crashed during utxo flush!")

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


if __name__ == "__main__":
Expand Down

0 comments on commit 9dc2afe

Please sign in to comment.