[Twisted-Python] Hanging test cases (Was: Evangelism notes...)
Jp Calderone
exarkun at divmod.com
Fri May 6 02:00:50 EDT 2005
On Thu, 5 May 2005 11:49:20 -0700, Grant Baillie <grant at osafoundation.org> wrote:
>On May 4, 2005, at 1:08 PM, Mike C. Fletcher wrote:
>> * Project was delivered, paid for, and has been running in
>> production for a few weeks, but 2 reported bugs cropped up
>> o To fix one, needed to update to 2.0 (deferred object
>> cleanup)... this caused rather a lot of upset, as the
>> sysadmins were upset about such a huge package needing to be
>> updated (and they tried to do just the core packages first,
>> which doubled the work-load involved in preparing that
>> update versus using Sumo)
>> o Fixing the other was no big deal, except that something in
>> 2.0 changed how the test-suite was running so that it now
>> hung on completion...
>
>Did you ever figure out why? I have just run into similar behaviour myself
>after upgrading to 2.0. Here's an example that hangs for me on Mac OS X
>(10.4) after the final print:
>
>---------------
>from twisted.internet import reactor, defer, threads
>from twisted.trial.util import deferredResult
>from twisted.web.client import getPage
>import time
>
>
>def itFired(result):
> print "Deferred fired: %s" % result
> return result
>
>d = getPage("http://www.example.com/").addBoth(itFired)
>
>print "Returned: %s" % deferredResult(d)
>print "Done; exiting"
>---------------
>
>
>So far as I can tell, the python threading module has an atexit handler
>that's hanging. Also, if I replace the deferToThread() with a
>twisted.web.client.getPage(), I still get the same hang.
So as to be entirely clear, I'm going to limit this response to just one idea. If more details are desired, I can post a followup later (as long as someone asks for one). Anyway, for now, here's the meat of this post:
Do
_____not_____
use
deferredResult
(or deferredError or wait)
As someone who pushed for their existence, I apologize.
Jp
More information about the Twisted-Python
mailing list