[Zodb-checkins] CVS: ZODB3/ZEO/tests - forker.py:1.24

Barry Warsaw barry@wooz.org
Fri, 13 Dec 2002 14:40:16 -0500


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv15108

Modified Files:
	forker.py 
Log Message:
start_zeo_server(): Read 1024 bytes from the initial connection to the
admin address of the subprocess.  Better to gulp 'em now than sip 'em
later.

shutdown_zeo_server(): Same thing here, but notice that on Windows,
the recv() can raise an ECONNRESET, which I believe we can just
ignore.  (Will test this with Tim shortly.)


=== ZODB3/ZEO/tests/forker.py 1.23 => 1.24 ===
--- ZODB3/ZEO/tests/forker.py:1.23	Thu Dec 12 13:58:39 2002
+++ ZODB3/ZEO/tests/forker.py	Fri Dec 13 14:40:15 2002
@@ -88,7 +88,7 @@
         try:
             zLOG.LOG('forker', zLOG.DEBUG, 'connect %s' % i)
             s.connect(adminaddr)
-            ack = s.recv(1)
+            ack = s.recv(1024)
             zLOG.LOG('forker', zLOG.DEBUG, 'acked: %s' % ack)
             break
         except socket.error, e:
@@ -103,6 +103,9 @@
 def shutdown_zeo_server(adminaddr):
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     s.connect(adminaddr)
-    ack = s.recv(1)
+    try:
+        ack = s.recv(1024)
+    except socket.error, e:
+        if e[0] <> errno.ECONNRESET: raise
     zLOG.LOG('shutdownServer', zLOG.DEBUG, 'acked: %s' % ack)
     s.close()