<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Aug 5, 2013, at 2:09 AM, Benjamin BERTRAND <<a href="mailto:beenje@gmail.com">beenje@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">That's why the inlineCallbacks solves the problem. When I yield on the self.server.dataReceived, I wait for the deferred in the publish methods to fire and everything is clean when I close the connection.</div><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Is there another way to do that?</div></blockquote><br></div><div>Jonathan Lange wrote about this a long time ago:</div><div><br></div><div><a href="http://blackjml.livejournal.com/23029.html">http://blackjml.livejournal.com/23029.html</a></div><div><br></div><div>but better than doing that would be to avoid setting up and tearing down real TCP connections during your tests.  Those are slower than an in-memory thing (like you would get from twisted.test.proto_helpers, the one <b>and only</b> public module in our 'test' package) and also, as you have discovered, more unpredictable.</div><div><br></div><div>Is there any way to hand txredis a synthetic transport for testing?  If not, file a bug on it :).</div><div><br></div><div>-glyph</div><br></body></html>