-
Notifications
You must be signed in to change notification settings - Fork 450
Random PermissionError: [Errno 13] in test_cached_function_race_condition_when_persisting_output under Windows (AppVeyor) #540
Copy link
Copy link
Closed
Labels
Description
================================== FAILURES ===================================
_________ test_cached_function_race_condition_when_persisting_output __________
tmpdir = local('C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pytest-of-appveyor\\pytest-0\\test_cached_function_race_cond0')
capfd = <_pytest.capture.CaptureFixture object at 0x0000001640A62240>
@with_multiprocessing
def test_cached_function_race_condition_when_persisting_output(tmpdir, capfd):
# Test race condition where multiple processes are writing into
# the same output.pkl. See
# https://github.com/joblib/joblib/issues/490 for more details.
memory = Memory(cachedir=tmpdir.strpath)
func_cached = memory.cache(fast_func_with_complex_output)
Parallel(n_jobs=2)(delayed(func_cached)() for i in range(3))
stdout, stderr = capfd.readouterr()
# Checking both stdout and stderr (ongoing PR #434 may change
# logging destination) to make sure there is no exception while
# loading the results
exception_msg = 'Exception while loading results'
assert exception_msg not in stdout
> assert exception_msg not in stderr
E assert 'Exception w...ding results' not in "WARNING:root...pkl'\r\n\r\n"
E 'Exception while loading results' is contained here:
E oblib')]: Exception while loading results for fast_func_with_complex_output()
E ? +++++++++++++++++++++++++++++++
E Traceback (most recent call last):
E File "c:\python35-x64\lib\site-packages\joblib\memory.py", line 524, in _cached_call
E verbose=self._verbose)
E File "c:\python35-x64\lib\site-packages\joblib\memory.py", line 137, in _load_output
E result = numpy_pickle.load(filename, mmap_mode=mmap_mode)
E File "c:\python35-x64\lib\site-packages\joblib\numpy_pickle.py", line 570, in load
E with open(filename, 'rb') as f:
E PermissionError: [Errno 13] Permission denied: 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pytest-of-appveyor\\pytest-0\\test_cached_function_race_cond0\\joblib\\joblib\\test\\test_memory\\fast_func_with_complex_output\\72a755383fba437e4dead6ff3e3d81e3\\output.pkl'
capfd = <_pytest.capture.CaptureFixture object at 0x0000001640A62240>
exception_msg = 'Exception while loading results'
func_cached = MemorizedFunc(func=<function fast_func_with_complex_output at 0x000000163FA5A598>, cachedir='C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pytest-of-appveyor\\pytest-0\\test_cached_function_race_cond0\\joblib')
memory = Memory(cachedir='C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pytest-of-appveyor\\pytest-0\\test_cached_function_race_cond0\\joblib')
stderr = "WARNING:root:[MemorizedFunc(func=<function fast_func_with_complex_output at 0x000000CDFC7BF510>, cachedir='C:\\\\User...lib\\\\test\\\\test_memory\\\\fast_func_with_complex_output\\\\72a755383fba437e4dead6ff3e3d81e3\\\\output.pkl'\r\n\r\n"
stdout = ''
tmpdir = local('C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pytest-of-appveyor\\pytest-0\\test_cached_function_race_cond0')
c:\python35-x64\lib\site-packages\joblib\test\test_memory.py:765: AssertionError
============== 1 failed, 1021 passed, 4 skipped in 85.09 seconds ==============
It's likely that the fix is to add the case for errno 13 in addition to errno 5 in concurrency_safe_rename under windows.
Reactions are currently unavailable