[Zodb-checkins] CVS: StandaloneZODB/ZEO/tests - forker.py:1.5.2.1

Jeremy Hylton jeremy@zope.com
Tue, 7 Aug 2001 18:32:53 -0400


Update of /cvs-repository/StandaloneZODB/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv11967

Modified Files:
      Tag: zeo-1_0-branch
	forker.py 
Log Message:
Try harder to avoid port already in use errors


=== StandaloneZODB/ZEO/tests/forker.py 1.5 => 1.5.2.1 ===
     if domain == "AF_INET":
         import random
-        addr = '', random.randrange(2000, 3000)
+        addr = '', random.randrange(25000, 30000)
     elif domain == "AF_UNIX":
         import tempfile
         addr = tempfile.mktemp()
     else:
         raise ValueError, "bad domain: %s" % domain
 
-    pid, exit = start_zeo_server(storage, addr)
+    for i in 1, 2, 3:
+        try:
+            pid, exit = start_zeo_server(storage, addr)
+        except socket.error, (num, msg):
+            if num == 98:
+                continue
+            else:
+                raise
+        else:
+            break
     s = ZEO.ClientStorage.ClientStorage(addr, storage_id,
                                         debug=1, client=cache,
                                         cache_size=cache_size,