Skip to content

Conversation

@corona10
Copy link
Member

@corona10corona10 commented Mar 16, 2024

@corona10
Copy link
MemberAuthor

@corona10corona10 changed the title gh-112536: Add more TSAN tests[Test] gh-112536: Add more TSAN testsMar 16, 2024
@corona10corona10 changed the title [Test] gh-112536: Add more TSAN testsgh-112536: Add more TSAN testsMar 16, 2024
@corona10corona10 requested a review from pitrouMarch 16, 2024 11:31
@corona10corona10 marked this pull request as ready for review March 16, 2024 11:32
@corona10corona10 requested a review from colesburyMarch 16, 2024 11:34
@corona10
Copy link
MemberAuthor

corona10 commented Mar 16, 2024

test_pickle
test_compileall
test_fork1

@pitrou
Those tests are currently not passed with PYTHON_GIL =0, but if they are not working with TSAN test, no worth adding it.
swtaarrs@1fe9165#diff-590c02490d066378045dd48d62e86dc85d3fb4ad934b6a2b2b0b1112e59eaefb
Thank you for pointing out :)

'test_importlib',
'test_io',
'test_logging',
'test_queue',
Copy link
MemberAuthor

@corona10corona10Mar 16, 2024

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_threadedtempfile',
'test_threading_local',
'test_threadsignals',
'test_weakref',
Copy link
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

@corona10corona10 requested a review from pitrouMarch 16, 2024 13:01
@pitroupitrou enabled auto-merge (squash) March 16, 2024 14:37
@pitroupitrou merged commit bee7e29 into python:mainMar 16, 2024
pitrou added a commit to pitrou/cpython that referenced this pull request Mar 17, 2024
vstinner pushed a commit to vstinner/cpython that referenced this pull request Mar 20, 2024
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@corona10@pitrou