diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index 18066ba18ac..d3620b70513 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -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() diff --git a/Misc/NEWS b/Misc/NEWS index 4b5d102361c..7ed716c8ef4 100644 --- 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.