[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/twisted/tests/test_inputbuffering.py
Merged from 3.2 branch:
Jim Fulton
jim at zope.com
Sat Dec 24 11:53:53 EST 2005
Log message for revision 41030:
Merged from 3.2 branch:
------------------------------------------------------------------------
r40988 | jim | 2005-12-22 15:18:57 -0500 (Thu, 22 Dec 2005) | 3 lines
Added code to make the client wait for a server to shutdown (I hope).
Maybe this will fix the tear-down failure we're seeing on windows.
Changed:
U Zope3/trunk/src/zope/app/twisted/tests/test_inputbuffering.py
-=-
Modified: Zope3/trunk/src/zope/app/twisted/tests/test_inputbuffering.py
===================================================================
--- Zope3/trunk/src/zope/app/twisted/tests/test_inputbuffering.py 2005-12-24 16:52:11 UTC (rev 41029)
+++ Zope3/trunk/src/zope/app/twisted/tests/test_inputbuffering.py 2005-12-24 16:53:53 UTC (rev 41030)
@@ -191,6 +191,7 @@
)
response = connection.getresponse()
connection.close()
+ self.waittodie()
def main_page(self):
connection = httplib.HTTPConnection('localhost', self.port)
@@ -216,6 +217,20 @@
raise
s.close()
+ def waittodie(self):
+ addr = 'localhost', self.port
+ for i in range(120):
+ time.sleep(0.25)
+ try:
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ s.connect(addr)
+ s.close()
+ except socket.error, e:
+ if e[0] not in (errno.ECONNREFUSED, errno.ECONNRESET):
+ raise
+ s.close()
+ break
+
url = property(lambda self: 'http://localhost:%d/' % self.port)
def mkfile(dir, name, template, kw):
More information about the Zope3-Checkins
mailing list