summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_concurrent_futures.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-02 19:20:25 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-02 19:20:25 (GMT)
commit020436b0d4ae271638ed5d0881c1fa7f7c0a1b09 (patch)
treead620d4691d253b267ff7c3d03c7bc3811bceca9 /Lib/test/test_concurrent_futures.py
parentaac0f75b3b28513c45116534720e66b0262e2e72 (diff)
downloadcpython-020436b0d4ae271638ed5d0881c1fa7f7c0a1b09.zip
cpython-020436b0d4ae271638ed5d0881c1fa7f7c0a1b09.tar.gz
cpython-020436b0d4ae271638ed5d0881c1fa7f7c0a1b09.tar.bz2
Issue #12456: fix a possible hang on shutdown of a concurrent.futures.ProcessPoolExecutor.
Diffstat (limited to 'Lib/test/test_concurrent_futures.py')
-rw-r--r--Lib/test/test_concurrent_futures.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py
index 5968980..fda6f5b 100644
--- a/Lib/test/test_concurrent_futures.py
+++ b/Lib/test/test_concurrent_futures.py
@@ -367,6 +367,13 @@ class ExecutorTest(unittest.TestCase):
self.assertEqual([None, None], results)
+ def test_shutdown_race_issue12456(self):
+ # Issue #12456: race condition at shutdown where trying to post a
+ # sentinel in the call queue blocks (the queue is full while processes
+ # have exited).
+ self.executor.map(str, [2] * (self.worker_count + 1))
+ self.executor.shutdown()
+
class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest):
def test_map_submits_without_iteration(self):