Skip to content

Commit

Permalink
Add skip_tmpdir_check arg in crash script (facebook#11539)
Browse files Browse the repository at this point in the history
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: facebook#11539

Test Plan: Ran locally

Reviewed By: anand1976

Differential Revision: D46740456

Pulled By: akankshamahajan15

fbshipit-source-id: 8726882ef53d2c84b604c7515e84eda6d1bf797c
  • Loading branch information
akankshamahajan15 authored and facebook-github-bot committed Jun 27, 2023
1 parent f7aa70a commit 5187ac2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/db_crashtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down Expand Up @@ -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())
Expand All @@ -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)
Expand Down

0 comments on commit 5187ac2

Please sign in to comment.