Skip to content

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commented Sep 12, 2023

test_asyncio and test_compileall now clean up multiprocessing by calling _cleanup_tests() method: explicitly clean up resources and stop background processes like the resource tracker.

test_asyncio and test_compileall now clean up multiprocessing by calling multiprocessing _cleanup_tests(): explicitly clean up resources and stop background processes like the resource tracker.
@vstinnervstinner added tests Tests in the Lib/test dir needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Sep 12, 2023
@gvanrossumgvanrossum changed the title gh-109295: test_asyncio and test_compileall clean multiprocessinggh-109295: Clean up multiprocessing in test_asyncio and test_compileallSep 12, 2023
Copy link
Member

@gvanrossumgvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gah. Why do we have compileall and py_compile in the stdlib. :-( (That's a rhetorical question.)

@vstinnervstinner merged commit 09ea4b8 into python:mainSep 12, 2023
@vstinnervstinner deleted the cleanup_tests branch September 12, 2023 01:31
@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 12, 2023
…mpileall (pythonGH-109298) test_asyncio and test_compileall now clean up multiprocessing by calling multiprocessing _cleanup_tests(): explicitly clean up resources and stop background processes like the resource tracker. (cherry picked from commit 09ea4b8) Co-authored-by: Victor Stinner <vstinner@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 12, 2023
…mpileall (pythonGH-109298) test_asyncio and test_compileall now clean up multiprocessing by calling multiprocessing _cleanup_tests(): explicitly clean up resources and stop background processes like the resource tracker. (cherry picked from commit 09ea4b8) Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

GH-109301 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12 only security fixes label Sep 12, 2023
@bedevere-app
Copy link

GH-109302 is a backport of this pull request to the 3.11 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.11 only security fixes label Sep 12, 2023
@vstinner
Copy link
MemberAuthor

Gah. Why do we have compileall and py_compile in the stdlib. :-( (That's a rhetorical question.)

Well, why do we have asyncio and multiprocessing in the stlidb? Why do you have a stdlib? (That's a rhetorical question.) 😂

@vstinner
Copy link
MemberAuthor

I would prefer that multiprocessing and concurrent.futures would have a more explicit API to manage resources. Rather than spawning processes in the background with no public API to be aware of that, nor an API to cleanup these processes. There are temporary directories, processes, shared memory, etc. Not trivial resources like a single large memory block.

vstinner added a commit that referenced this pull request Sep 12, 2023
…ompileall (GH-109298) (#109302) gh-109295: Clean up multiprocessing in test_asyncio and test_compileall (GH-109298) test_asyncio and test_compileall now clean up multiprocessing by calling multiprocessing _cleanup_tests(): explicitly clean up resources and stop background processes like the resource tracker. (cherry picked from commit 09ea4b8) Co-authored-by: Victor Stinner <vstinner@python.org>
Yhg1s pushed a commit that referenced this pull request Sep 12, 2023
…ompileall (GH-109298) (#109301) gh-109295: Clean up multiprocessing in test_asyncio and test_compileall (GH-109298) test_asyncio and test_compileall now clean up multiprocessing by calling multiprocessing _cleanup_tests(): explicitly clean up resources and stop background processes like the resource tracker. (cherry picked from commit 09ea4b8) Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit to vstinner/cpython that referenced this pull request Sep 13, 2023
…mpileall (python#109298) test_asyncio and test_compileall now clean up multiprocessing by calling multiprocessing _cleanup_tests(): explicitly clean up resources and stop background processes like the resource tracker.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@miss-islington@gvanrossum