From aa71464410acdfd1f7b33dc034e0886b67bffac0 Mon Sep 17 00:00:00 2001 From: Hui Xiao Date: Thu, 29 Sep 2022 16:29:51 -0700 Subject: [PATCH] Remove and recreate expected values dir in white-box testing 2nd half (#10743) Summary: **Context:** https://github.com/facebook/rocksdb/pull/10732#pullrequestreview-1121076205 Pull Request resolved: https://github.com/facebook/rocksdb/pull/10743 Test Plan: - Locally run `python3 ./tools/db_crashtest.py whitebox --simple -max_key=1000000 -value_size_mult=33 -write_buffer_size=524288 -target_file_size_base=524288 -max_bytes_for_level_base=2097152 --duration=120 --interval=10 --ops_per_thread=1000 --random_kill_odd=887` - CI jobs testing Reviewed By: ajkr Differential Revision: D39838733 Pulled By: ajkr fbshipit-source-id: 9e819b66b0293dfc7a31a908a9d42c6baca4aeaa --- tools/db_crashtest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index bc17a0115..953cabee9 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -904,7 +904,10 @@ def whitebox_crash_main(args, unknown_args): # success shutil.rmtree(dbname, True) os.mkdir(dbname) - cmd_params.pop("expected_values_dir", None) + if (expected_values_dir is not None): + shutil.rmtree(expected_values_dir, True) + os.mkdir(expected_values_dir) + check_mode = (check_mode + 1) % total_check_mode time.sleep(1) # time to stabilize after a kill