memory: add test for call_and_shelve performance#791
Conversation
This test verifies call_and_shelve doesn't perform a load of cached data every time it is used
Codecov Report
@@ Coverage Diff @@
## master #791 +/- ##
==========================================
+ Coverage 94.73% 95.36% +0.63%
==========================================
Files 44 44
Lines 6319 6340 +21
==========================================
+ Hits 5986 6046 +60
+ Misses 333 294 -39
Continue to review full report at Codecov.
|
|
Ok, it's failing on windows because the access time is not accurate enough (I found this that explains why). |
18f0bc3 to
db8aa11
Compare
f5d2ced to
6252e85
Compare
|
@ogrisel, I updated the test the way we discussed IRL. |
joblib/test/test_memory.py
Outdated
| in str(w[-1].message) | ||
|
|
||
|
|
||
| def test_call_and_shelve_performance(tmpdir): |
There was a problem hiding this comment.
_performance is really too generic a name. Please rename to "test_call_and_shelve_lazily_load_stored_result".
joblib/test/test_memory.py
Outdated
| if test_access_time == os.stat(test_access_time_file.strpath).st_atime: | ||
| # Skip this test when access time cannot be retrieved with enough | ||
| # precision from the file system (e.g. NTFS on windows). | ||
| return |
There was a problem hiding this comment.
Please use pytest.skip("filesystem does not support fine-grained access time attribute") to make it explicitly that the test is skipped.
|
@ogrisel, comments addressed |
|
The appveyor failure seems unrelated |
6ef0d13 to
6d3a59e
Compare
|
I'v retriggered the CI and now it's all green again. |
* tag '0.13.0': Release 0.13.0 Use https (joblib#805) MTN bump loky to 2.4.2 (joblib#804) DOC: provide some useful variables for Makefile (joblib#794) DOC serialization and processes (joblib#803) ENH update loky 2.4.0 (joblib#802) FIX backward compatibility for nested backend (joblib#789) enable python 3.7 (joblib#795) memory: add test for call_and_shelve performance (joblib#791) FIX nested backend not changed by SequentialBackend (joblib#792) cloudpickle 0.6.0 (joblib#788) FIX nested backend setting n_jobs=-1 (joblib#785) Raises a more explicit exception when a corrupted MemorizedResult is loaded (joblib#768) Back to dev mode
* releases: Release 0.13.0 Use https (joblib#805) MTN bump loky to 2.4.2 (joblib#804) DOC: provide some useful variables for Makefile (joblib#794) DOC serialization and processes (joblib#803) ENH update loky 2.4.0 (joblib#802) FIX backward compatibility for nested backend (joblib#789) enable python 3.7 (joblib#795) memory: add test for call_and_shelve performance (joblib#791) FIX nested backend not changed by SequentialBackend (joblib#792) cloudpickle 0.6.0 (joblib#788) FIX nested backend setting n_jobs=-1 (joblib#785) Raises a more explicit exception when a corrupted MemorizedResult is loaded (joblib#768) Back to dev mode
This test verifies that the
call_and_shelvefunction doesn't perform a load of cached data every time it is used.The idea is to verify that the access time of the file containing the cached file. It should remain untouched after each calls. And getting result using
MemorizedResult.getwill change the access time since the data must be read.See #757