Skip to content

Commit 5534c04

Browse files
committed
Made test_output_path thread safe
ref:e52e12fe79febd9f1724c863c4eaf462e15461bb
1 parent f39f7ec commit 5534c04

File tree

1 file changed

+6
-2
lines changed
  • library/python/testing/yatest_common/yatest/common

1 file changed

+6
-2
lines changed

library/python/testing/yatest_common/yatest/common/runtime.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import os
1+
import errno
22
import functools
33
import json
4+
import os
45
import threading
56

67
import six
@@ -181,8 +182,11 @@ def test_output_path(path=None):
181182
"""
182183
import pytest
183184
test_out_dir = os.path.splitext(pytest.config.current_test_log_path)[0]
184-
if not os.path.exists(test_out_dir):
185+
try:
185186
os.makedirs(test_out_dir)
187+
except OSError as e:
188+
if e.errno != errno.EEXIST:
189+
raise
186190
return _join_path(test_out_dir, path)
187191

188192

0 commit comments

Comments
 (0)