Opened 15 years ago

Closed 14 years ago

#1113 defect closed fixed (fixed)

intermittent test failure in testCallLater

Reported by: warner Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Jean-Paul Calderone, warner Branch:


Change History (5)

comment:1 Changed 15 years ago by warner

The buildbot is seeing a timing-related test failure in testCallLater:

[FAIL]: twisted.test.test_internet.InterfaceTestCase.testCallLater

"/home/buildbot/BuildBot/slave/full2.3/Twisted/twisted/internet/", line
109, in maybeDeferred
    result = f(*args, **kw)
line 222, in testCallLater
    self.assertApproximates(self._calledTime, start + 0.5, 0.2 )
"/home/buildbot/BuildBot/slave/full2.3/Twisted/twisted/trial/", line
418, in <lambda>
    assertApproximates = lambda self, a, b, c, msg=None: assertApproximates(a,
b, c, msg)
line 176, in assertApproximates
    raise FailTest, (msg or "%s ~== %s" % (first, second))
twisted.trial.assertions.FailTest: 1121392438.02 ~== 1121392437.74

Clearly this is a result of a heavily loaded test host being unable to complete
an operation within 200ms of the target time. Perhaps we can change the test to
assert some other property of the reactor.callLater function being exercised..
the fact that it completes at all? The fact that it does not complete *before* a
similar callLater that uses a shorter timeout? Likewise it should complete
before a callLater with a longer timeout?

There should probably still be a failsafe timeout, but it can use a much longer
value (30 seconds), because it should only ever be used when the reactor is so
horribly broken that timers fail altogether.


comment:2 Changed 14 years ago by Jean-Paul Calderone

Keywords: review added
Owner: Jean-Paul Calderone deleted
Priority: highhighest

Review in call-later-timing-failures-1113

comment:3 Changed 14 years ago by radix

Keywords: review removed
Owner: set to Jean-Paul Calderone
Priority: highestnormal

I can't think of anything bad to say about this change. Maybe the docstring of the TestCase, but I agree with it, so not really bad.

Merge it quickly, before I fully understand the terror of the test that it is replacing.

comment:4 Changed 14 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(In [17886]) Merge call-later-timing-failures-1113

Author: exarkun Reviewer: radix Fixes #1113

This replaces one confusing, load-sensitive callLater test with several documented, purposeful tests which should be immune to load-induced failures.

comment:5 Changed 9 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.