Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/test/libregrtest/tsan.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,13 +10,15 @@
'test_importlib',
'test_io',
'test_logging',
'test_queue',

@corona10corona10Mar 16, 2024

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

defqueue_join_test(self, q):

'test_ssl',
'test_syslog',
'test_thread',
'test_threadedtempfile',
'test_threading',
'test_threading_local',
'test_threadsignals',
'test_weakref',

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

@threading_helper.requires_working_threading()
deftest_threaded_weak_valued_setdefault(self):
d=weakref.WeakValueDictionary()
withcollect_in_thread():
foriinrange(100000):
x=d.setdefault(10, RefCycle())
self.assertIsNot(x, None) # we never put None in there!
delx
@threading_helper.requires_working_threading()
deftest_threaded_weak_valued_pop(self):
d=weakref.WeakValueDictionary()
withcollect_in_thread():
foriinrange(100000):
d[10] =RefCycle()
x=d.pop(10, 10)
self.assertIsNot(x, None) # we never put None in there!
@threading_helper.requires_working_threading()
deftest_threaded_weak_valued_consistency(self):
# Issue #28427: old keys should not remove new values from
# WeakValueDictionary when collecting from another thread.
d=weakref.WeakValueDictionary()
withcollect_in_thread():
foriinrange(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

]


Expand Down