Skip to content

Commit 98ad8c1

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

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/functional/feature_dbcrash.py

+9-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)
@@ -270,6 +272,11 @@ def run_test(self):
270272
utxo_list = self.nodes[3].listunspent()
271273
self.log.debug(f"Node3 utxo count: {len(utxo_list)}")
272274

275+
if i >= 9:
276+
raise AssertionError(f"10 iterations without node crash, this should not happen")
277+
else:
278+
i += 1
279+
273280
# Check that the utxo hashes agree with node3
274281
# Useful side effect: each utxo cache gets flushed here, so that we
275282
# won't get crashes on shutdown at the end of the test.

0 commit comments

Comments
 (0)