[Zodb-checkins] SVN: ZODB/trunk/src/ZEO/tests/forker.py Fixed a bug in the logic for finding available sockets for testing.

Jim Fulton jim at zope.com
Sat Nov 15 10:39:55 EST 2008


Log message for revision 92979:
  Fixed a bug in the logic for finding available sockets for testing.
  Maybe this will reduce the chance if spurious test failures due to
  addresses already in use.  Unfortunately, there's still a race that
  may make running tests in parallel impractical until it's addressed.
  

Changed:
  U   ZODB/trunk/src/ZEO/tests/forker.py

-=-
Modified: ZODB/trunk/src/ZEO/tests/forker.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/forker.py	2008-11-15 15:30:54 UTC (rev 92978)
+++ ZODB/trunk/src/ZEO/tests/forker.py	2008-11-15 15:39:55 UTC (rev 92979)
@@ -220,10 +220,20 @@
         try:
             try:
                 s.connect(('localhost', port))
+            except socket.error:
+                pass  # Perhaps we should check value of error too.
+            else:
+                continue
+
+            try:
                 s1.connect(('localhost', port+1))
             except socket.error:
-                # Perhaps we should check value of error too.
-                return port
+                pass  # Perhaps we should check value of error too.
+            else:
+                continue
+
+            return port
+
         finally:
             s.close()
             s1.close()



More information about the Zodb-checkins mailing list