New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache test timing is unreliable #1147
Comments
I think this is fixed now. I hope. |
It's not fixed. 😦 I just had to re-run Travis a couple times because the cache tests kept failing. |
@mitsuhiko A commit you made (7a3a91a) seems to have undone changes to the test layout. It added back Going to try reverting the added file and see if the tests stay stable. |
Tests for #1233 passed the first time, so I'm going to close this for now. |
Hi, will this be closed under #1249 (deprecate werkzeug.contrib.cache)? Otherwise, I've "reproduced" the Appveyor Windows failed test on 6 Jan 2018 at https://ci.appveyor.com/project/pallets/werkzeug/build/1/job/bnt1188d64tysdr5 (noting Travis was mentioned above). TL;DR: test_generic_timeout rarely broken, test_filesystemcache_clear always broken? Environment:
pytest: platform win32 -- Python 3.6.5, pytest-3.5.0, py-1.5.3, pluggy-0.6.0 Observations:
So the previous line 129 has failed to set? (I had originally written that raising fast_sleep(3) to fast_sleep(10) decreased repro rate of this error. fast_sleep is called on line 131...) More interesting to me, the test test_filesystemcache_clear seems to fail 100% of the time, even with a delay like fast_sleep(30). The AssertionError I have is the same as at the end of the Appveyor build above.
The file created by the cache is left on-disk. I've confirmed the source on disk includes the changes in 'Merge pull request #1233' 8393ee8 Because of that commit, I'm expecting _guaranteed_deletes to be True. Not reaching it in the above test, safe to ignore? Removing the file interactively works:
(The implementation of clear() in FileSystemCache.) There is no OSError caught in the implementation of clear(). I.e., os.remove() does not appear to throw. I could try and look at this in more depth if it's not to be closed? I'm new. I'll accept any advice. Thank you for your time. |
Closing this since we're not going to be maintaining the cache contrib. I'm going to disable tests for now so they don't cause problems with other PRs. |
Raising the sleep time helps, but not consistently. And it makes the tests slower. I'm not even clear why they fail: if a cache key is set to timeout after a certain period, sleeping longer than that period should mean the key is no longer valid. We need to retry the test so that random unrelated failures don't keep popping up in new PRs.
The text was updated successfully, but these errors were encountered: