diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 27ba4e689c..ae7ebe6020 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -986,6 +986,8 @@ def narrow_crash_main(args, unknown_args): time.sleep(2) # time to stabilize before the next run shutil.rmtree(dbname, True) + for ctr in range(max(0, counter - 2), counter): + shutil.rmtree('{}_{}'.format(dbname, ctr), True) # This script runs and kills db_stress multiple times. It checks consistency @@ -1039,7 +1041,7 @@ def blackbox_crash_main(args, unknown_args): # we need to clean up after ourselves -- only do this on test success shutil.rmtree(dbname, True) for ctr in range(max(0, counter - 2), counter): - shutil.rmtree('{}_{}'.format(dbname, ctr)) + shutil.rmtree('{}_{}'.format(dbname, ctr), True) # This python script runs db_stress multiple times. Some runs with @@ -1236,12 +1238,12 @@ def whitebox_crash_main(args, unknown_args): expected_values_dir = None check_mode = (check_mode + 1) % total_check_mode - for ctr in range(max(0, counter - 2), counter): - shutil.rmtree('{}_{}'.format(dbname, ctr)) - counter = 0 time.sleep(1) # time to stabilize after a kill + for ctr in range(max(0, counter - 2), counter): + shutil.rmtree('{}_{}'.format(dbname, ctr), True) + def bool_converter(v): s = v.lower().strip() @@ -1304,7 +1306,7 @@ def main(): args, unknown_args = parser.parse_known_args() test_tmpdir = os.environ.get(_TEST_DIR_ENV_VAR) - if test_tmpdir is not None and not args.skip_tmpdir_check: + if test_tmpdir and not args.skip_tmpdir_check: isdir = False try: isdir = os.path.isdir(test_tmpdir)