[Twisted-Python] defer.TimeoutError in tests
Hi! I have some tests that fail intermittently, i.e. sometimes they fail, sometimes they don't. These tests were written against real server. When I run these tests, the following errors may or may not occur: [ERROR] Traceback (most recent call last): Failure: twisted.internet.defer.TimeoutError: <...> still running at 120.0 secs [ERROR] Traceback (most recent call last): Failure: twisted.trial.util.DirtyReactorAggregateError: Reactor was unclean. Selectables: <<class 'twisted.internet.tcp.Client'> to ('localhost', 8081) at 1eb1750> I don't understand these errors. The server is up and running, but for some reason connections are timed out. The code under test uses perspective broker to talk to the server. I can't figure out where the problem is -- on the server or in the code under test (the client). I have found some information that can help me to tackle the problem -- http://twistedmatrix.com/trac/ticket/2869 But what can be the reason of such intermittent errors? Sorry, right now I can't provide a self contained example that demonstrates the problem, because testing code is rather complex. At first, I would like to know if there is something I could pay attention to. Thanks in advance. -- with regards, Maxim
On Wed, Nov 7, 2012 at 6:11 AM, Maxim Lacrima <lacrima.maxim@gmail.com>wrote:
When I run these tests, the following errors may or may not occur: [ERROR] Traceback (most recent call last): Failure: twisted.internet.defer.TimeoutError: <...> still running at 120.0 secs
[ERROR] Traceback (most recent call last): Failure: twisted.trial.util.DirtyReactorAggregateError: Reactor was unclean. Selectables: <<class 'twisted.internet.tcp.Client'> to ('localhost', 8081) at 1eb1750>
I don't understand these errors. The server is up and running, but for some reason connections are timed out.
The connection isn't timing out, the *test* is timing out. The connection may be working just fine. Due to an unknown reason, presumably a bug in your code (or test code), the Deferred you are returning from the test method isn't being fired. E.g. you're not calling callback()/errback(), or a callback method you added is returning a Deferred that is in turn not being fired. -- Itamar Turner-Trauring, Future Foundries LLC http://futurefoundries.com/ — Twisted consulting, training and support.
The connection isn't timing out, the *test* is timing out. The connection may be working just fine.
Due to an unknown reason, presumably a bug in your code (or test code), the Deferred you are returning from the test method isn't being fired. E.g. you're not calling callback()/errback(), or a callback method you added is returning a Deferred that is in turn not being fired.
Hi, Itamar! Thanks for your reply. Yes, this was a bug in my code, which caused Deferred to never fire under some circumstances. -- with regards, Maxim
participants (2)
-
Itamar Turner-Trauring
-
Maxim Lacrima