diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py index 20fe0b42e04..2423d0bcbb7 100755 --- a/test/functional/feature_dbcrash.py +++ b/test/functional/feature_dbcrash.py @@ -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) @@ -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__":