Skip to content

gh-83386: Enable test_hang_gh83386 for ProcessPoolExecutor#152976

Merged
gpshead merged 1 commit into
python:mainfrom
gpshead:fix-gh-83386-unskip-test
Jul 3, 2026
Merged

gh-83386: Enable test_hang_gh83386 for ProcessPoolExecutor#152976
gpshead merged 1 commit into
python:mainfrom
gpshead:fix-gh-83386-unskip-test

Conversation

@gpshead

@gpshead gpshead commented Jul 3, 2026

Copy link
Copy Markdown
Member

The hang this test guards against (interpreter exit after shutdown(wait=False) with running futures) was fixed for ProcessPoolExecutor by the executor management rewrite in ~3.9 years ago (probably #17670 fixing bpo-39104 but i didn't confirm exactly), but the test stayed skipped.

The skip meaning the code was never maintained also hid a latent NameError in the subprocess template, which only selects a start method in the process pool variants; rewrite it to use the same mp_context=get_context() shape as the other templates.

Also remove a stale comment claiming ProcessPoolExecutor often hangs with wait=False.

Closes: #83386

The hang this test guards against (interpreter exit after
shutdown(wait=False) with running futures) was fixed for
ProcessPoolExecutor by the executor management rewrite years ago, but
the test still skipped it citing the issue. The skip also hid a latent
NameError in the subprocess template, which only selects a start method
in the process pool variants; rewrite it to use the same
mp_context=get_context() shape as the sibling templates. Remove a stale
comment claiming ProcessPoolExecutor often hangs with wait=False.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@gpshead gpshead self-assigned this Jul 3, 2026
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jul 3, 2026
@gpshead gpshead added skip news needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes 🔨 test-with-buildbots Test PR w/ buildbots; report in status section labels Jul 3, 2026
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @gpshead for commit e9ff212 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F152976%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 3, 2026
@gpshead gpshead marked this pull request as ready for review July 3, 2026 21:01
@gpshead gpshead merged commit 548c731 into python:main Jul 3, 2026
80 of 90 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 3, 2026

Copy link
Copy Markdown

GH-152982 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 3, 2026
@bedevere-app

bedevere-app Bot commented Jul 3, 2026

Copy link
Copy Markdown

GH-152983 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 3, 2026
gpshead added a commit that referenced this pull request Jul 3, 2026
…-152976) (#152982)

gh-83386: Enable test_hang_gh83386 for ProcessPoolExecutor (GH-152976)

The hang this test guards against (interpreter exit after
shutdown(wait=False) with running futures) was fixed for
ProcessPoolExecutor by the executor management rewrite years ago, but
the test still skipped it citing the issue. The skip also hid a latent
NameError in the subprocess template, which only selects a start method
in the process pool variants; rewrite it to use the same
mp_context=get_context() shape as the sibling templates. Remove a stale
comment claiming ProcessPoolExecutor often hangs with wait=False.
(cherry picked from commit 548c731)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multiprocessing: Hang when interpreter exits after ProcessPoolExecutor.shutdown(wait=False)

2 participants