Skip to content

Commit

Permalink
Update python test check_data (infiniflow#1773)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Update python test check_data function
Ignore conflict if multiple test jobs create the same dir repeatedly

### Type of change

- [x] Test cases
  • Loading branch information
yangzq50 authored Aug 30, 2024
1 parent 4b10067 commit da427c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/parallel_test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def check_data(request):
data_dir = request.param["data_dir"]
# path not exists
if not os.path.exists(data_dir):
os.makedirs(data_dir)
os.makedirs(data_dir, exist_ok=True)
return False
if not os.path.exists(data_dir + file_name):
return False
Expand Down
2 changes: 1 addition & 1 deletion python/test_http_api/httputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ def generate_commas_enwiki(in_filename, out_filename, is_embedding):
def check_data(data_dir):
# path not exists
if not os.path.exists(data_dir):
os.makedirs(data_dir)
os.makedirs(data_dir, exist_ok=True)
return False
2 changes: 1 addition & 1 deletion python/test_pysdk/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def check_data(request):
data_dir = request.param["data_dir"]
# path not exists
if not os.path.exists(data_dir):
os.makedirs(data_dir)
os.makedirs(data_dir, exist_ok=True)
return False
if not os.path.exists(data_dir + file_name):
return False
Expand Down

0 comments on commit da427c2

Please sign in to comment.