[Zodb-checkins] CVS: Zope3/src/zodb/zeo/tests - forker.py:1.3 connection.py:1.3

Jeremy Hylton jeremy@zope.com
Fri, 24 Jan 2003 18:21:22 -0500


Update of /cvs-repository/Zope3/src/zodb/zeo/tests
In directory cvs.zope.org:/tmp/cvs-serv31712/zodb/zeo/tests

Modified Files:
	forker.py connection.py 
Log Message:
Merge new-pickle-branch to trunk.  Yee ha!


=== Zope3/src/zodb/zeo/tests/forker.py 1.2 => 1.3 ===
--- Zope3/src/zodb/zeo/tests/forker.py:1.2	Wed Dec 25 09:12:22 2002
+++ Zope3/src/zodb/zeo/tests/forker.py	Fri Jan 24 18:20:48 2003
@@ -51,7 +51,8 @@
     raise RuntimeError, "Can't find port"
 
 
-def start_zeo_server(conf, addr=None, ro_svr=False, keep=False):
+def start_zeo_server(conf, addr=None, ro_svr=False, keep=False,
+                     admin_retries=5):
     """Start a ZEO server in a separate process.
 
     Returns the ZEO port, the test server port, and the pid.
@@ -83,7 +84,7 @@
     adminaddr = ('localhost', port+1)
     # We need to wait until the server starts, but not forever
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-    for i in range(5):
+    for i in range(admin_retries):
         try:
             logging.debug('forker: connect %s', i)
             s.connect(adminaddr)


=== Zope3/src/zodb/zeo/tests/connection.py 1.2 => 1.3 ===
--- Zope3/src/zodb/zeo/tests/connection.py:1.2	Wed Dec 25 09:12:22 2002
+++ Zope3/src/zodb/zeo/tests/connection.py	Fri Jan 24 18:20:48 2003
@@ -117,6 +117,11 @@
         storage.registerDB(DummyDB())
         return storage
 
+    # The start_zeo_server() function attempts to connect to the new
+    # server process once a second.  After forker_admin_retries attempts,
+    # it fails with an error.
+    forker_admin_retries = 5
+
     def startServer(self, create=True, index=0,
                     read_only=False, ro_svr=False, keep=False):
         addr = self.addr[index]
@@ -125,7 +130,7 @@
         path = "%s.%d" % (self.file, index)
         conf = self.getConfig(path, create, read_only)
         zeoport, adminaddr, pid = forker.start_zeo_server(
-            conf, addr, ro_svr, keep)
+            conf, addr, ro_svr, keep, self.forker_admin_retries)
         self._pids.append(pid)
         self._servers.append(adminaddr)
 
@@ -421,6 +426,7 @@
 
 class ReconnectionTests(CommonSetupTearDown):
     keep = True
+    forker_admin_retries = 10
 
     def checkReadOnlyStorage(self):
         # Open a read-only client to a read-only *storage*; stores fail