[Python-checkins] cpython (merge 3.1 -> 3.2): Try to fix sporadic test_multiprocessing failure

antoine.pitrou python-checkins at python.org
Tue Apr 5 18:13:20 CEST 2011


http://hg.python.org/cpython/rev/8a65e6aff672
changeset:   69158:8a65e6aff672
branch:      3.2
parent:      69155:a7363288c8d4
parent:      69157:7a1ef59d765b
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Tue Apr 05 18:12:15 2011 +0200
summary:
  Try to fix sporadic test_multiprocessing failure

files:
  Lib/test/test_multiprocessing.py |  12 +++++++++++-
  1 files changed, 11 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -11,6 +11,7 @@
 import sys
 import os
 import gc
+import errno
 import signal
 import array
 import socket
@@ -1359,7 +1360,16 @@
         manager.shutdown()
         manager = QueueManager(
             address=addr, authkey=authkey, serializer=SERIALIZER)
-        manager.start()
+        try:
+            manager.start()
+        except IOError as e:
+            if e.errno != errno.EADDRINUSE:
+                raise
+            # Retry after some time, in case the old socket was lingering
+            # (sporadic failure on buildbots)
+            time.sleep(1.0)
+            manager = QueueManager(
+                address=addr, authkey=authkey, serializer=SERIALIZER)
         manager.shutdown()
 
 #

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list