Skip to content

Commit

Permalink
Make tests multi-process friendly. (#3683)
Browse files Browse the repository at this point in the history
This side effect at module import time has a race condition between the "exists" check and the "mkdir" call.  The safer thing is to just call mkdir and catch the "already exists" error which is what makedirs does.
  • Loading branch information
thatch authored and jroesch committed Aug 1, 2019
1 parent b9544d7 commit 8db483b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/tvm/contrib/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def _download_progress(count, block_size, total_size):


TEST_DATA_ROOT_PATH = os.path.join(os.path.expanduser('~'), '.tvm_test_data')
if not os.path.exists(TEST_DATA_ROOT_PATH):
os.mkdir(TEST_DATA_ROOT_PATH)
os.makedirs(TEST_DATA_ROOT_PATH, exist_ok=True)


def download_testdata(url, relpath, module=None):
"""Downloads the test data from the internet.
Expand Down

0 comments on commit 8db483b

Please sign in to comment.