[Twisted-Python] Possible trial -u / threads bug

Jonathan Lange jml at mumak.net
Mon Feb 12 01:23:06 EST 2007

On 2/10/07, Mark Leonard <mwl at point45.com> wrote:
> Hi,
> I'm encountering a problem when using deferToThread in a unit test and
> running it with trial -u.
> The code below demonstrates the problem. It fails (by timing out) on the
> second pass.
> It seems to fail reliably on Twisted 2.5.0 (Python 2.5.0), but on a
> Twisted 2.0.1 (Python 2.4.1) installation it works just fine.
> I think the problem is related to trial's cleanup of the threadpool. I
> did try (as a test) add reactor.threadpool.stop() to tearDown and
> reactor.threadpool.start() to setUp, but it had no effect on the second
> pass failure.
> Can anybody confirm the problem and, if so, should I create a ticket for it?

Hey Mark,

I've run your code against trunk, and the problem definitely occurs
there. This definitely is a bug -- if a test passes without -u, it
should pass with -u.

Please file a bug at http://twistedmatrix.com/trac/newticket and make
sure that it's in the "Trial" component.


More information about the Twisted-Python mailing list