Merged revisions 76840 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76840 | r.david.murray | 2009-12-14 16:57:39 -0500 (Mon, 14 Dec 2009) | 3 lines
Issue #7498: make test_multiprocessing use test_support.find_unused_port
instead of a hard coded port number in test_rapid_restart.
........
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index 58647ed..107cd62 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -18,6 +18,7 @@
import random
import logging
from StringIO import StringIO
+from test import test_support
# Work around broken sem_open implementations
@@ -1204,8 +1205,9 @@
def test_rapid_restart(self):
authkey = os.urandom(32)
+ port = test_support.find_unused_port()
manager = QueueManager(
- address=('localhost', 9999), authkey=authkey, serializer=SERIALIZER)
+ address=('localhost', port), authkey=authkey, serializer=SERIALIZER)
manager.start()
p = self.Process(target=self._putter, args=(manager.address, authkey))
@@ -1215,7 +1217,7 @@
del queue
manager.shutdown()
manager = QueueManager(
- address=('localhost', 9999), authkey=authkey, serializer=SERIALIZER)
+ address=('localhost', port), authkey=authkey, serializer=SERIALIZER)
manager.start()
manager.shutdown()