<br><br><div class="gmail_quote">On 5 April 2011 14:21,  <span dir="ltr">&lt;<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 01:39 am, <a href="mailto:brad.milne@devx.runthered.com">brad.milne@devx.runthered.com</a> wrote:<br>
&gt;Hi all<br>
&gt;<br>
&gt;I have recently started switching to trial.unittest from python&#39;s own.<br>
&gt;The<br>
&gt;trouble I&#39;m experiencing is when a timeout occurs in my test, it<br>
&gt;errbacks().<br>
&gt;Then the @inlineCallbacks decorator sees the error and errbacks(). But<br>
&gt;then<br>
&gt;a second @inlineCallback in the chain subsequently sees *that* errback<br>
&gt;and<br>
&gt;tries to errback itself. This results in AlreadyCalledError.<br>
&gt;<br>
&gt;In the test setup, various services are started. These are tracked and<br>
&gt;then<br>
&gt;shutdown again in the teardown. Also, there is some polling that<br>
&gt;happens as<br>
&gt;part of the tests (waiting on db activities, for example). These use<br>
&gt;deferLater calls, which are also tracked and torn down in the teardown.<br>
&gt;<br>
&gt;I&#39;ve tried _suppressAlreadyCalled in various places to no avail.<br>
&gt;<br>
&gt;Below is a simple example that shows the problem.<br>
<br>
</div>I tried running the sample, it completes without error.  I guess that&#39;s<br>
not what you&#39;re seeing?  What version of Twisted do you have?<br>
<br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div><br><br>
<div>Hi Jean-Paul</div><div><br></div><div>I&#39;m using 10.2.0 on a mac. Here&#39;s my interpreter (using buildout):</div><div><br></div><div><div>#!/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python</div>
<div>import sys</div><div>sys.path[0:0] = [</div><div>    &#39;/Users/brad/Development/python/workspace/Python-Integration/src&#39;,</div><div>    &#39;/Users/brad/Development/python/eggs/nose-0.11.4-py2.6.egg&#39;,</div>
<div>    &#39;/Users/brad/Development/python/eggs/MiniMock-1.2.5-py2.6.egg&#39;,</div><div>    &#39;/Users/brad/Development/python/eggs/suds-0.4-py2.6.egg&#39;,</div><div>    &#39;/Users/brad/Development/python/eggs/SOAPpy-0.12.4-py2.6.egg&#39;,</div>
<div>    &#39;/Users/brad/Development/python/eggs/wstools-0.3-py2.6.egg&#39;,</div><div>    &#39;/Users/brad/Development/python/eggs/fpconst-0.7.2-py2.6.egg&#39;,</div><div>    &#39;/Users/brad/Development/python/eggs/Twisted-10.2.0-py2.6-macosx-10.6-x86_64.egg&#39;,</div>
<div>    &#39;/Users/brad/Development/python/eggs/zope.interface-3.6.1-py2.6-macosx-10.6-x86_64.egg&#39;,</div><div>    &#39;/Users/brad/Development/python/eggs/pymongo-1.9-py2.6-macosx-10.6-x86_64.egg&#39;,</div><div>    &#39;/Users/brad/Development/python/eggs/pytz-2010h-py2.6.egg&#39;,</div>
<div>    ]</div></div><div><br></div><div>The python I have at that location (using MacPorts) is 2.6.6.</div><div><br></div><div>Following your email I see that 11.0.0 is released so I tried that and got the same error:</div>
<div>&lt;snip&gt;</div><div><div>[ERROR]</div><div>Traceback (most recent call last):</div><div>  File &quot;/Users/brad/Development/python/eggs/Twisted-11.0.0-py2.6-macosx-10.6-x86_64.egg/twisted/internet/defer.py&quot;, line 1076, in gotResult</div>
<div>    _inlineCallbacks(r, g, deferred)</div><div>  File &quot;/Users/brad/Development/python/eggs/Twisted-11.0.0-py2.6-macosx-10.6-x86_64.egg/twisted/internet/defer.py&quot;, line 1066, in _inlineCallbacks</div><div>    deferred.errback()</div>
<div>  File &quot;/Users/brad/Development/python/eggs/Twisted-11.0.0-py2.6-macosx-10.6-x86_64.egg/twisted/internet/defer.py&quot;, line 388, in errback</div><div>    self._startRunCallbacks(fail)</div><div>  File &quot;/Users/brad/Development/python/eggs/Twisted-11.0.0-py2.6-macosx-10.6-x86_64.egg/twisted/internet/defer.py&quot;, line 448, in _startRunCallbacks</div>
<div>    raise AlreadyCalledError</div><div>twisted.internet.defer.AlreadyCalledError: </div></div><div>&lt;/snip&gt;</div><div><br></div><div>Many thanks</div><div>Brad</div>