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

Skip to content

Commit c824e9a

Browse files
committed
Try to fix sporadic test_multiprocessing failure
1 parent 4f61b02 commit c824e9a

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
@@ -12,6 +12,7 @@
1212
import sys
1313
import os
1414
import gc
15+
import errno
1516
import signal
1617
import array
1718
import socket
@@ -1277,7 +1278,16 @@ def test_rapid_restart(self):
12771278
manager.shutdown()
12781279
manager = QueueManager(
12791280
address=addr, authkey=authkey, serializer=SERIALIZER)
1280-
manager.start()
1281+
try:
1282+
manager.start()
1283+
except IOError as e:
1284+
if e.errno != errno.EADDRINUSE:
1285+
raise
1286+
# Retry after some time, in case the old socket was lingering
1287+
# (sporadic failure on buildbots)
1288+
time.sleep(1.0)
1289+
manager = QueueManager(
1290+
address=addr, authkey=authkey, serializer=SERIALIZER)
12811291
manager.shutdown()
12821292

12831293
#

0 commit comments

Comments
 (0)