Skip to content

Commit 7fc5991

Browse files
committed
change to max of 10 iterations with early exit on success
1 parent afc822c commit 7fc5991

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/functional/feature_dbcrash.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ def run_test(self):
238238
# Main test loop:
239239
# each time through the loop, generate a bunch of transactions,
240240
# and then either mine a single new block on the tip, or some-sized reorg.
241-
# ELEMENTS: reduced iters to run in some "reasonable" amount of time (~6 hours)
242-
for i in range(6):
241+
# ELEMENTS: modified to only run until successfully testing a node crash on restart
242+
# with a maximum of 10 iterations
243+
i = 0
244+
while self.crashed_on_restart < 1:
243245
self.log.info(f"Iteration {i}, generating 2500 transactions {self.restart_counts}")
244246
# Generate a bunch of small-ish transactions
245247
self.generate_small_transactions(self.nodes[3], 2500, utxo_list)
@@ -288,6 +290,10 @@ def run_test(self):
288290
for i in range(3):
289291
if self.restart_counts[i] == 0:
290292
self.log.warning(f"Node {i} never crashed during utxo flush!")
293+
if i >= 9:
294+
raise AssertionError(f"10 iterations without node crash, this should not happen")
295+
else:
296+
i += 1
291297

292298

293299
if __name__ == "__main__":

0 commit comments

Comments
 (0)