-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Async tests sometimes randomly cause errors #137
Comments
@dgelessus I'm not 100% convinced these two are the same problem. The second one could be explained by task scheduling; That might be caused by some manifestation of the first problem - but I think it's just as likely as some random occasional slowdown in signal processing (and thus async task allocation). If we were to increase the timeout to something more than 0.5 seconds, I'd suspect we'd see that test failure disappear. As for the first failure - I think you're right that it's a race condition, I'd guess something around the cancellation of socket handles and/or the disabling of the socket write operation. The naïve fix would be to check to see if In both cases - What sort of frequency do you see these failures? Do you have any reliably way of increasing the frequency of the failure? e.g., is it more frequent if your CPU or network is under load? Or if the disk is thrashing? I've tried reproducing them locally by running the async tests over and over again, but I haven't seen any manifestation of the problem... |
The first error occurs quite often for me, it usually only takes one or two full Tox runs for it to appear for at least one Python version. (It's not specific to any particular Python version - testing all of them simply makes it more likely to appear.) My machine isn't under any unusual load (the only major CPU load is the test suite, disk activity is not an issue since I have an SSD, and there's no noticeable network activity). The error also appears on Travis sometimes, which should also have pretty average system load. The second error is new to me and I haven't been able to reproduce it properly. I saw it in one of the Travis builds for #136, but the original log is now gone since I restarted the build in question. |
FYI - the first of these two errors ('NoneType' object is not iterable) is corrected by #238. I'm fairly certain the second problem is entirely down to task scheduling, and as such, probably isn't fixable. On that basis, I'm not sure if we should close this bug "as fixed as it's going to get", or leave it open in case anyone sees the behaviour in future. |
The async tests (tests/test_async.py) sometimes cause errors for no apparent reason. For example, this error message appears every now and then for me locally and on Travis:
This is an exception that was raised from inside a
ctypes
callback function, which means that it cannot propagate normally. When this happens,ctypes
prints out the exception, but it does not terminate Python like uncaught exceptions normally do, and the test in question does not count as failed. Because of this, the error has been more or less ignored so far (or perhaps not even noticed when it appeared).Another error that I've just come across is this:
Unlike the first error, this is an actual test failure.
I'm really not familiar with the async-related parts of Rubicon, so I don't know what could be going wrong here. I'm not sure if these two errors are even related, but I'm reporting them together, because they are both related to some sort of timing problem or race condition that is not noticeable very often.
The text was updated successfully, but these errors were encountered: