Skip to content

Commit 9dc2afe

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

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

test/functional/feature_dbcrash.py

+12-5
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)
@@ -285,9 +287,14 @@ def run_test(self):
285287
assert self.crashed_on_restart > 0
286288

287289
# Warn if any of the nodes escaped restart.
288-
for i in range(3):
289-
if self.restart_counts[i] == 0:
290-
self.log.warning(f"Node {i} never crashed during utxo flush!")
290+
for j in range(3):
291+
if self.restart_counts[j] == 0:
292+
self.log.warning(f"Node {j} never crashed during utxo flush!")
293+
294+
if i >= 9:
295+
raise AssertionError(f"10 iterations without node crash, this should not happen")
296+
else:
297+
i += 1
291298

292299

293300
if __name__ == "__main__":

0 commit comments

Comments
 (0)