[Twisted-Python] trial & ThreadedResolver._cleanup

Justin Mazzola Paluska jmp at MIT.EDU
Mon Jul 14 11:59:29 EDT 2008


I’m writing a bunch of unit tests using Twisted’s Trial.  I’ve been
trying to chase down some issues with my code leaving the reactor
unclean.  I think I’ve gotten most of them out of the way, except for

/usr/lib/python2.4/site-packages/twisted/trial/reporter.py:142: twisted.trial.reporter.BrokenTestCaseWarning: REACTOR UNCLEAN! traceback(s) follow: 
  File "/usr/lib/python2.4/site-packages/twisted/trial/util.py", line 72, in _dispatch
    getattr(self, "do_%s" % attr)()
  File "/usr/lib/python2.4/site-packages/twisted/trial/util.py", line 99, in do_cleanPending
    raise PendingTimedCallsError(s)
twisted.trial.util.PendingTimedCallsError: pendingTimedCalls still pending (consider setting twisted.internet.base.DelayedCall.debug = True): <DelayedCall -1219829012 [59.9999289513s] called=0 cancelled=0 ThreadedResolver._cleanup(u'localhost', <Deferred at 0xB74AE46CL>)>

When I run my tests individually (one invocation of trial per test), I
don’t get any errors.  It’s only when I run an entire suite that I get
these errors.

It looks like this is a reported issue
(http://twistedmatrix.com/trac/ticket/2579), but with no fix.

Does anyone know a workaround for this issue?

More information about the Twisted-Python mailing list