From 5187ac2af3600bd85bff20b2a2d353c46ba63d6f Mon Sep 17 00:00:00 2001 From: Akanksha Mahajan <43301668+akankshamahajan15@users.noreply.github.com> Date: Tue, 27 Jun 2023 12:30:19 -0700 Subject: [PATCH] Add skip_tmpdir_check arg in crash script (#11539) Summary: Add `skip_tmpdir_check` argument in crash script. If `tmp_dir` is on remote storage and exist, `isdir` will be false (checking on local storage) leading to exit. By passing `skip_tmpdir_check` with `crashtest.py`, the dir check can be skipped. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11539 Test Plan: Ran locally Reviewed By: anand1976 Differential Revision: D46740456 Pulled By: akankshamahajan15 fbshipit-source-id: 8726882ef53d2c84b604c7515e84eda6d1bf797c --- tools/db_crashtest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index f33afe1bb..1a3821aa1 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -734,6 +734,7 @@ def gen_cmd(params, unknown_params): "stress_cmd", "test_tiered_storage", "cleanup_cmd", + "skip_tmpdir_check" } and v is not None ] @@ -1016,6 +1017,7 @@ def main(): parser.add_argument("--stress_cmd") parser.add_argument("--test_tiered_storage", action="store_true") parser.add_argument("--cleanup_cmd") + parser.add_argument("--skip_tmpdir_check", action="store_true") all_params = dict( list(default_params.items()) @@ -1042,13 +1044,13 @@ def main(): args, unknown_args = parser.parse_known_args() test_tmpdir = os.environ.get(_TEST_DIR_ENV_VAR) - if test_tmpdir is not None: + if test_tmpdir is not None and not args.skip_tmpdir_check: isdir = False try: isdir = os.path.isdir(test_tmpdir) if not isdir: print( - "%s env var is set to a non-existent directory: %s" + "ERROR: %s env var is set to a non-existent directory: %s. Update it to correct directory path." % (_TEST_DIR_ENV_VAR, test_tmpdir) ) sys.exit(1)