Skip to content

Commit 5bed242

Browse files
committed
Fix TOCTOU race condition in tests/system_tests.py
Fixes some failures when running tests in parallel Signed-off-by: Sertonix <[email protected]>
1 parent 080c66a commit 5bed242

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/system_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ def configure_suite(config_file):
155155
abs_path = os.path.abspath(
156156
os.path.join(_parameters["suite_root"], rel_path)
157157
)
158-
if key == "tmp_path" and not os.path.isdir(abs_path):
159-
os.mkdir(abs_path)
158+
if key == "tmp_path":
159+
os.makedirs(abs_path, exist_ok=True)
160160
if key == "data_path" and not os.path.exists(abs_path):
161161
raise ValueError(
162162
"Path replacement for {short}: {abspath} does not exist"

0 commit comments

Comments
 (0)