]> granicus.if.org Git - python/commitdiff
Merged revisions 76840 via svnmerge from
authorR. David Murray <rdmurray@bitdance.com>
Mon, 14 Dec 2009 22:18:57 +0000 (22:18 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Mon, 14 Dec 2009 22:18:57 +0000 (22:18 +0000)
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.
........

Lib/test/test_multiprocessing.py
Misc/NEWS

index 58647ed0f8766204163114ec0cbb9ac97585e841..107cd622ac1f6f9f88763edceb33fc4e6a49119c 100644 (file)
@@ -18,6 +18,7 @@ import socket
 import random
 import logging
 from StringIO import StringIO
+from test import test_support
 
 
 # Work around broken sem_open implementations
@@ -1204,8 +1205,9 @@ class _TestManagerRestart(BaseTestCase):
 
     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 @@ class _TestManagerRestart(BaseTestCase):
         del queue
         manager.shutdown()
         manager = QueueManager(
-            address=('localhost', 9999), authkey=authkey, serializer=SERIALIZER)
+            address=('localhost', port), authkey=authkey, serializer=SERIALIZER)
         manager.start()
         manager.shutdown()
 
index a933f62584911452a08de04829156ea0b843d989..c16e6977f10e832bc850586835d7e94b45719cea 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -118,6 +118,9 @@ Build
 Tests
 -----
 
+- Issue #7498: test_multiprocessing now uses test_support.find_unused_port
+  instead of a hardcoded port number in test_rapid_restart.
+
 - Issue #7431: use TESTFN in test_linecache instead of trying to create a 
   file in the Lib/test directory, which might be read-only for the
   user running the tests.