-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-112536: Add more TSAN tests #116896
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-112536: Add more TSAN tests #116896
Conversation
@pitrou |
@@ -10,12 +10,14 @@ | |||
'test_importlib', | |||
'test_io', | |||
'test_logging', | |||
'test_queue', |
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.
cpython/Lib/test/test_queue.py
Line 165 in 86bc40d
def queue_join_test(self, q): |
'test_ssl', | ||
'test_syslog', | ||
'test_thread', | ||
'test_threadedtempfile', | ||
'test_threading_local', | ||
'test_threadsignals', | ||
'test_weakref', |
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.
cpython/Lib/test/test_weakref.py
Lines 1837 to 1866 in 86bc40d
@threading_helper.requires_working_threading() | |
def test_threaded_weak_valued_setdefault(self): | |
d = weakref.WeakValueDictionary() | |
with collect_in_thread(): | |
for i in range(100000): | |
x = d.setdefault(10, RefCycle()) | |
self.assertIsNot(x, None) # we never put None in there! | |
del x | |
@threading_helper.requires_working_threading() | |
def test_threaded_weak_valued_pop(self): | |
d = weakref.WeakValueDictionary() | |
with collect_in_thread(): | |
for i in range(100000): | |
d[10] = RefCycle() | |
x = d.pop(10, 10) | |
self.assertIsNot(x, None) # we never put None in there! | |
@threading_helper.requires_working_threading() | |
def test_threaded_weak_valued_consistency(self): | |
# Issue #28427: old keys should not remove new values from | |
# WeakValueDictionary when collecting from another thread. | |
d = weakref.WeakValueDictionary() | |
with collect_in_thread(): | |
for i in range(200000): | |
o = RefCycle() | |
d[10] = o | |
# o is still alive, so the dict can't be empty | |
self.assertEqual(len(d), 1) | |
o = None # lose ref |
--------- Co-authored-by: Antoine Pitrou <[email protected]>
--------- Co-authored-by: Antoine Pitrou <[email protected]>
--------- Co-authored-by: Antoine Pitrou <[email protected]>
--------- Co-authored-by: Antoine Pitrou <[email protected]>
--with-thread-sanitizer
#112536