[Twisted-Python] Refactoring of trial - call for feature requests and suggestions

Glyph Lefkowitz glyph at divmod.com
Tue Jun 15 14:14:03 EDT 2004

On Tue, 2004-06-15 at 12:26, Christopher Armstrong wrote:

> I don't think it should be calling iterate() at all -- just a regular 
> run(). In fact, I was considering rewriting said functions in 
> twisted.trial.util to use that just today. Instead of spinning the 
> reactor until something is appended to some list via a callback, make 
> the callback stop the reactor.

There are multiple, parallel issues here :).  First is that the reactor
needs a genuine make-sure-i'm-cleaned-up function.  The current usage of
iterate() has its roots in the fact that shutdown is (used to be?)
horribly buggy and slightly destructive - if memory serves, the original
problem was that the threadpool was destroyed and could not be
re-created properly.

Second is that we shouldn't be waiting on deferreds in test code any
more than we should be waiting on deferreds in real code.  The different
approaches to waiting on deferreds currently mean there are still lots
of places the tests can hang.  With a more unified approach, we could
insert default timeouts on ALL tests more easily, and avoid loops that
wait for multiple deferreds by using, e.g. DeferredList.

Third is the fact that we have piles and piles of badly-written test
code which would need to be changed to support any modifications to
trial.  This one I'm not sure about how to deal with.

Maybe it'd be better to focus more on the split-out until that's
finished with, because we're not going to be able to use anything new
until then anyway.

More information about the Twisted-Python mailing list