Merged revisions 76843 via svnmerge from
authorR. David Murray <rdmurray@bitdance.com>
Mon, 14 Dec 2009 22:57:04 +0000 (22:57 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Mon, 14 Dec 2009 22:57:04 +0000 (22:57 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r76843 | r.david.murray | 2009-12-14 17:45:15 -0500 (Mon, 14 Dec 2009) | 10 lines

  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.
  ........
................

Lib/test/test_multiprocessing.py
Misc/NEWS

index 18066ba18ac0dbae2abdbaf845731c5d0ee128ae..d3620b70513515b3a7ce596197156a3f5ec3a0b4 100644 (file)
@@ -1213,8 +1213,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))
@@ -1224,7 +1225,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 4b5d102361c3d983cf8eb409aba0e83a82fcd6ba..7ed716c8ef49a45ff7ff3a7b3e139943c3043b02 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -214,6 +214,9 @@ Extension Modules
 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.