[test]Fix occasional FileExistsError triggered when concurrently executing pytest (#26867)

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing 2023-09-06 12:07:14 +08:00 committed by GitHub
parent 0e2085b77f
commit 2f32623d16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
import os
import datetime
from pathlib import Path
class LogConfig:
def __init__(self):
@ -23,10 +23,10 @@ class LogConfig:
@staticmethod
def create_path(log_path):
if not os.path.isdir(str(log_path)):
print("[create_path] folder(%s) is not exist." % log_path)
print("[create_path] create path now...")
os.makedirs(log_path)
print("[create_path] folder(%s) is not exist." % log_path)
print("[create_path] create path now...")
folder_path = Path(str(log_path))
folder_path.mkdir(parents=True, exist_ok=True)
def get_default_config(self):
""" Make sure the path exists """