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
Optimized various tests. #13496
Optimized various tests. #13496
Conversation
49f6d96
to
924e111
Compare
924e111
to
5361667
Compare
Thanks 🚀 On Oracle:
|
There are 8 cache backends to test and each test of touch() takes ~7s → ~56s. This seems excessive and it feels like we should be able to reduce this significantly. time.sleep() accepts floating point values and is guaranteed to sleep for at least the number of seconds specified as of Python 3.5. We do run the risk that there may be spurious test failures from this, but that already seemed to be the case anyway.
5361667
to
177a49e
Compare
That's exactly what I was hoping for! |
That's great. however not the final word. I already got a failing test on a PR which could be related ( |
@claudep Indeed, but these failures did crop up on occasion before. I don't have a rate of how often, but these things are hard to measure reliably anyway. I thought the saving made it at least worth trying, on the basis that we can review over the coming days/weeks and tweak or revert if we perceive it to be worse. So thank you for the first report! 😄 In case you missed it, I discussed this above: #13496 (comment) |
I've just seen the same failure of |
Thanks for the heads-up @timgraham. So here is the relevant bit of the test: # cache.touch() updates the timeout.
cache.set('expire1', 'very quickly', timeout=1)
self.assertIs(cache.touch('expire1', timeout=2), True)
time.sleep(1.0)
self.assertIs(cache.has_key('expire1'), True)
time.sleep(1.5)
self.assertIs(cache.has_key('expire1'), False) So the flow is:
We're failing at step 4. For that to happen we must be losing a whole second somewhere… I note that there is some guidance on troubleshooting timeouts. I wonder if anything crops up in the memcached stats related to maximum connections @felixxm? |
Hmm. Just seen a lot more touch failures. It is rather strange that we would need to wait for multiple seconds. Are all parallel test runs executed on the same memcached instance on CI? I presume that there is some sort of key prefixing if so, otherwise this is bound to fail. Or are too many parallel runs causing too many connections or too much load on memcached per the link in my previous comment. Perhaps it is just easier to revert 177a49e, but it feels like there is some underlying problem… |
Yes, based on a Python version, database and build name, so it's properly isolated.
Agreed let's revert it (#13565), there is no doubt that it caused more frequent failures. We need to investigate this more closely 🕵️ |
See commit messages for explanations.