]> granicus.if.org Git - python/commitdiff
Try to fix sporadic test_multiprocessing failure
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 5 Apr 2011 16:11:33 +0000 (18:11 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 5 Apr 2011 16:11:33 +0000 (18:11 +0200)
Lib/test/test_multiprocessing.py

index 1136ab2920edf8e710fe6dc3f8c8653ec7deca07..3e467d5ea0b500a3d7928f7b6532d6c81e3bcb04 100644 (file)
@@ -12,6 +12,7 @@ import io
 import sys
 import os
 import gc
+import errno
 import signal
 import array
 import socket
@@ -1277,7 +1278,16 @@ class _TestManagerRestart(BaseTestCase):
         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()
 
 #