[Zope3-checkins] CVS: Zope3/src/zope/server/http/tests -
test_httpserver.py:1.6
Tim Peters
tim.one at comcast.net
Mon Apr 26 11:28:21 EDT 2004
Update of /cvs-repository/Zope3/src/zope/server/http/tests
In directory cvs.zope.org:/tmp/cvs-serv10797/src/zope/server/http/tests
Modified Files:
test_httpserver.py
Log Message:
testManyClients: Use fewer connections on Windows platforms earlier than
NT (they can't handle 50 sockets open simulataneously, and this test
has always failed on Win98SE because of that).
=== Zope3/src/zope/server/http/tests/test_httpserver.py 1.5 => 1.6 ===
--- Zope3/src/zope/server/http/tests/test_httpserver.py:1.5 Fri Jun 6 15:29:12 2003
+++ Zope3/src/zope/server/http/tests/test_httpserver.py Mon Apr 26 11:28:20 2004
@@ -205,8 +205,30 @@
body=(s * 100)) # 100 KB
def testManyClients(self):
+ import sys
+
+ # Set the number of connections to make. A previous comment said
+ # Linux kernel (2.4.8) doesn't like > 128.
+ # The test used to use 50. Win98SE can't handle that many, dying
+ # with
+ # File "C:\PYTHON23\Lib\httplib.py", line 548, in connect
+ # raise socket.error, msg
+ # error: (10055, 'No buffer space available')
+ nconn = 50
+ if sys.platform == 'win32':
+ platform = sys.getwindowsversion()[3]
+ if platform < 2:
+ # 0 is Win32s on Windows 3.1
+ # 1 is 95/98/ME
+ # 2 is NT/2000/XP
+
+ # Pre-NT. 20 should work. The exact number you can get away
+ # with depends on what you're running at the same time (e.g.,
+ # browsers and AIM and email delivery consume sockets too).
+ nconn = 20
+
conns = []
- for n in range(50): # Linux kernel (2.4.8) doesn't like > 128 ?
+ for n in range(nconn):
#print 'open', n, clock()
h = HTTPConnection(LOCALHOST, self.port)
#h.debuglevel = 1
More information about the Zope3-Checkins
mailing list