Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04026cf

Browse files
committed
Try to fix sporadic test_multiprocessing failure
2 parents 02ba73c + c824e9a commit 04026cf

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

Lib/test/test_multiprocessing.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import sys
1212
import os
1313
import gc
14+
import errno
1415
import signal
1516
import array
1617
import socket
@@ -1359,7 +1360,16 @@ def test_rapid_restart(self):
13591360
manager.shutdown()
13601361
manager = QueueManager(
13611362
address=addr, authkey=authkey, serializer=SERIALIZER)
1362-
manager.start()
1363+
try:
1364+
manager.start()
1365+
except IOError as e:
1366+
if e.errno != errno.EADDRINUSE:
1367+
raise
1368+
# Retry after some time, in case the old socket was lingering
1369+
# (sporadic failure on buildbots)
1370+
time.sleep(1.0)
1371+
manager = QueueManager(
1372+
address=addr, authkey=authkey, serializer=SERIALIZER)
13631373
manager.shutdown()
13641374

13651375
#

0 commit comments

Comments
 (0)