Skip to content

Commit

Permalink
Move clean up to outside of the loop to cover more case
Browse files Browse the repository at this point in the history
  • Loading branch information
jaykorean committed Jan 19, 2024
1 parent 35d6c4d commit 4ba15f0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/db_crashtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,8 @@ def whitebox_crash_main(args, unknown_args):
kill_random_test = cmd_params["random_kill_odd"]
kill_mode = 0
prev_compaction_style = -1
expected = False
hit_timeout = False
while time.time() < exit_time:
if check_mode == 0:
additional_opts = {
Expand Down Expand Up @@ -1063,8 +1065,6 @@ def whitebox_crash_main(args, unknown_args):

if hit_timeout:
print("Killing the run for running too long")
# We treat the long running test as passing today. Clean up after ourselves
cleanup_and_exit_if_failed(dbname)
break

expected = False
Expand Down Expand Up @@ -1100,6 +1100,12 @@ def whitebox_crash_main(args, unknown_args):
time.sleep(1) # time to stabilize after a kill


# If successfully finished or timed out (we currently treat timed out test as passing)
# Clean up after ourselves
if expected or hit_timeout:
cleanup_and_exit_if_failed(dbname)


def main():
global stress_cmd
global cleanup_cmd
Expand Down

0 comments on commit 4ba15f0

Please sign in to comment.