Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45209: fix UserWarning: resource_tracker in test_multiprocessing #28377

Merged
merged 4 commits into from
Sep 21, 2021

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 15, 2021

@vstinner
Copy link
Member

cc @pitrou

@pitrou pitrou changed the title bpo-45209: removes UserWarning: resource_tracker in `test_multiproc… bpo-45209: fix UserWarning: resource_tracker in test_multiprocessing Sep 16, 2021
@vstinner
Copy link
Member

Windows build error on Azure Pipelines is tracked by: https://bugs.python.org/issue45220

@sobolevn
Copy link
Member Author

Rebased, CI now passes.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. @pitrou: Would you mind to double check this multiprocessing test fix?

I'm kind of unhappy that you have to prepend "/". SharedMemory._prepend_leading_slash does a magic dance (add/remove "/" prefix) with SharedMemory(name) constructor parameter and in SharedMemory.name property. But I don't think that it's worth it to add something just for this very specific test. We can always revisit the code later if we start to have issue on some corner cases.

@sobolevn
Copy link
Member Author

I'm kind of unhappy that you have to prepend "/". SharedMemory._prepend_leading_slash does a magic dance (add/remove "/" prefix) with SharedMemory(name) constructor parameter and in SharedMemory.name property

Yes, me too. I've tried several other things like smm.name (was not producing the correct result by raising KeyError). After several attempts this was the simplest solution. And since we only run this part on posix, it should work correctly.

Thanks, @vstinner and @pitrou

@ambv
Copy link
Contributor

ambv commented Sep 21, 2021

Since the slash hack is tests-only, let's have it. We can fix the fix later if we find a way to do so.

@ambv ambv merged commit f604cf1 into python:main Sep 21, 2021
@vstinner vstinner added the needs backport to 3.10 only security fixes label Sep 21, 2021
@miss-islington
Copy link
Contributor

Thanks @sobolevn for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 21, 2021
pythonGH-28377)

(cherry picked from commit f604cf1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-bot
Copy link

GH-28499 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Sep 21, 2021
@vstinner vstinner added the needs backport to 3.9 only security fixes label Sep 21, 2021
@miss-islington
Copy link
Contributor

Thanks @sobolevn for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-28500 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Sep 21, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 21, 2021
pythonGH-28377)

(cherry picked from commit f604cf1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington added a commit that referenced this pull request Sep 21, 2021
GH-28377)

(cherry picked from commit f604cf1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
vstinner pushed a commit that referenced this pull request Sep 21, 2021
GH-28377) (GH-28500)

(cherry picked from commit f604cf1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants