bpo-26903: Limit ProcessPoolExecutor to 61 workers on Windows (GH-13132)

Co-Authored-By: brianquinlan <brian@sweetapp.com>
This commit is contained in:
Brian Quinlan 2019-05-08 14:04:53 -04:00 committed by Steve Dower
parent b9b08cd948
commit 39889864c0
4 changed files with 26 additions and 0 deletions

View file

@ -755,6 +755,13 @@ class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest, BaseTestCase):
class ProcessPoolExecutorTest(ExecutorTest):
@unittest.skipUnless(sys.platform=='win32', 'Windows-only process limit')
def test_max_workers_too_large(self):
with self.assertRaisesRegex(ValueError,
"max_workers must be <= 61"):
futures.ProcessPoolExecutor(max_workers=62)
def test_killed_child(self):
# When a child process is abruptly terminated, the whole pool gets
# "broken".