<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Hey again!</div><div>Having the setup doing quite well so far, I just ran into a problem that I do not know how to debug:</div><div><br></div><div>Testcase `setUp()` starts a server that subclasses `twisted.web.resource.Resource` , as it's going to be a lightweight SOAP server, responding with hard-coded xml strings.</div><div>Purpose is to check the request for validity.</div><div><br></div><div>The Testcase's `test_*()` function initiates a client request by using the suds module. I now discovered that the server process started in `setUp()` hangs as long as the suds connection did not finish.</div><div>Which is a deadlock, as it cannot finish unless the server sent the response.</div><div><br></div><div>When trying to connect to the server via telnet, I do not get any response unless the suds connection is lost.</div><div><br></div><div>Snippets:</div><div>TestCase:&nbsp;<a href="http://dpaste.org/pmg6Y/">http://dpaste.org/pmg6Y/</a></div><div>TestServer:&nbsp;<a href="http://dpaste.org/NOLb8/">http://dpaste.org/NOLb8/</a></div><div>Client:&nbsp;<a href="http://dpaste.org/2wxIV/">http://dpaste.org/2wxIV/</a></div><div><br></div><div>Thanks for any help!</div><div>Fabian</div><div><br></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Fabian Rothfuchs &lt;<a href="mailto:fabian.rothfuchs@googmail.com">fabian.rothfuchs@googmail.com</a>&gt;<br><span style="font-weight:bold">Date: </span> Thursday, January 17, 2013 11:27 AM<br><span style="font-weight:bold">To: </span> Twisted general discussion &lt;<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>&gt;<br><span style="font-weight:bold">Subject: </span> Re: [Twisted-Python] Stopping Reactor in UnitTest Callback<br></div><div><br></div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; ">While trying to minimalize my code, I discovered that the following line somewhere down deep the code is causing the whole test to hang:</div><div><blockquote style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; margin: 0px 0px 0px 40px; border: none; padding: 0px; "><p style="margin: 0px; font-size: 11px; font-family: Monaco; ">adbapi.ConnectionPool(<span style="color: #00b400">'MySQLdb'</span>, system.host, system.username, system.password, system.database)</p><p style="margin: 0px; font-size: 11px; font-family: Monaco; "><br></p></blockquote><div><p style="margin: 0px; "><font face="Calibri,sans-serif">It seems that the&nbsp;connection is not being closed properly, causing the whole test chain to hang.</font></p></div></div><div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; "><br></div><span id="OLK_SRC_BODY_SECTION" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; "><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Itamar Turner-Trauring &lt;<a href="mailto:itamar@futurefoundries.com">itamar@futurefoundries.com</a>&gt;<br><span style="font-weight:bold">Reply-To: </span> Twisted general discussion &lt;<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>&gt;<br><span style="font-weight:bold">Date: </span> Tuesday, January 15, 2013 6:22 PM<br><span style="font-weight:bold">To: </span> Twisted general discussion &lt;<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>&gt;<br><span style="font-weight:bold">Subject: </span> Re: [Twisted-Python] Stopping Reactor in UnitTest Callback<br></div><div><br></div><br><br><div class="gmail_quote">On Tue, Jan 15, 2013 at 10:26 AM, Fabian Rothfuchs <span dir="ltr">&lt;<a href="mailto:fabian.rothfuchs@googlemail.com" target="_blank">fabian.rothfuchs@googlemail.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 style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word"><div>Yes, I thought so, too. Indeed it happens that the reactor is started automatically, but after the test succeeds, it's not being stopped (only chance is to kill &#8211;9 it).<br></div></div></blockquote><div><br>Perhaps the problem isn't with the test framework, but with your test. Can you show us a minimal piece of code that reproduces the problem?<br></div></div>
_______________________________________________
Twisted-Python mailing list
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a></span></div></div></span></body></html>