Skip to content

Commit 75ac805

Browse files
committed
adding test
1 parent fc006bf commit 75ac805

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Lib/test/test_concurrent_futures.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,19 @@ def test_shutdown_no_wait(self):
568568
# shutdown.
569569
assert all([r == abs(v) for r, v in zip(res, range(-5, 5))])
570570

571+
def test_hang_issue45021(self):
572+
"""https://bugs.python.org/issue45021"""
573+
def submit(pool):
574+
pool.submit(submit, pool)
575+
576+
if hasattr(os, 'register_at_fork'):
577+
with futures.ThreadPoolExecutor(1) as pool:
578+
pool.submit(submit, pool)
579+
580+
for _ in range(50):
581+
with futures.ProcessPoolExecutor(1, mp_context=get_context('fork')) as workers:
582+
workers.submit(tuple)
583+
571584

572585
create_executor_tests(ProcessPoolShutdownTest,
573586
executor_mixins=(ProcessPoolForkMixin,

0 commit comments

Comments
 (0)