Skip to content

Commit

Permalink
Rename cleanup function
Browse files Browse the repository at this point in the history
  • Loading branch information
jaykorean committed Jan 19, 2024
1 parent 4ba15f0 commit 0e97714
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/db_crashtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ def exit_if_stderr_has_errors(stderr, print_stderr=True):
print("TEST FAILED. Output has 'fail'!!!\n")
sys.exit(2)

def cleanup_and_exit_if_failed(dbname):
def cleanup_after_success(dbname):
shutil.rmtree(dbname, True)
if cleanup_cmd is not None:
print("Running DB cleanup command - %s\n" % cleanup_cmd)
Expand Down Expand Up @@ -919,7 +919,7 @@ def blackbox_crash_main(args, unknown_args):
exit_if_stderr_has_errors(errs)

# we need to clean up after ourselves -- only do this on test success
cleanup_and_exit_if_failed(dbname)
cleanup_after_success(dbname)


# This python script runs db_stress multiple times. Some runs with
Expand Down Expand Up @@ -1086,7 +1086,7 @@ def whitebox_crash_main(args, unknown_args):
# First half of the duration, keep doing kill test. For the next half,
# try different modes.
if time.time() > half_time:
cleanup_and_exit_if_failed(dbname)
cleanup_after_success(dbname)
try:
os.mkdir(dbname)
except OSError:
Expand All @@ -1103,7 +1103,7 @@ def whitebox_crash_main(args, unknown_args):
# 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)
cleanup_after_success(dbname)


def main():
Expand Down

0 comments on commit 0e97714

Please sign in to comment.