-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-132113: Make EnvironmentVarGuard
thread safe
#132128
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
gh-132113: Make EnvironmentVarGuard
thread safe
#132128
Conversation
Looks related to #132113 - can you add the issue number to the title? edit: re "Please do not review yet", you can mark this PR as a draft by clicking the "Convert to draft" button under "Reviewers" in the right-hand column |
EnvironmentVarGuard
thread safeEnvironmentVarGuard
thread safe
fbe6202
to
a8a295f
Compare
Could you add a news entry? thanks! |
Can you add a test please? and/or confirm that the reproducer given on the issue is fixed? |
@@ -794,6 +797,27 @@ def test_linked_to_musl(self): | |||
for v in linked: | |||
self.assertIsInstance(v, int) | |||
|
|||
def test_threadsafe_environmentvarguard(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should be executed more than once. I think, so I would suggest doing something like that (when I executed the script in my terminal, I needed more than one script execution to see the issue)
def test_threadsafe_environmentvarguard(self):
for _ in range(100):
self._test_threadsafe_environmentvarguard()
def _test_threadsafe_environmentvarguard(self):
...
Following Serhiy's explanation and considering I actually didn't think enough about this, I closed the issue. |
test.support.os_helper.EnvironmentVarGuard
is not thread safe #132113