Skip to content

gh-112536: Add more TSAN tests - #116896

Merged
pitrou merged 6 commits into
python:mainfrom
corona10:gh-112536-more-tests
Mar 16, 2024
Merged

gh-112536: Add more TSAN tests#116896
pitrou merged 6 commits into
python:mainfrom
corona10:gh-112536-more-tests

Conversation

@corona10

@corona10corona10 commented Mar 16, 2024

Copy link
Copy Markdown
Member

@corona10

Copy link
Copy Markdown
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
@corona10
corona10 requested a review from pitrouMarch 16, 2024 11:31
@corona10
corona10 marked this pull request as ready for review March 16, 2024 11:32
@corona10
corona10 requested a review from colesburyMarch 16, 2024 11:34
Comment threadLib/test/libregrtest/tsan.py Outdated
Comment threadLib/test/libregrtest/tsan.py Outdated
Comment threadLib/test/libregrtest/tsan.py Outdated
@corona10

corona10 commented Mar 16, 2024

Copy link
Copy Markdown
MemberAuthor

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',

@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_threadedtempfile',
'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

@corona10
corona10 requested a review from pitrouMarch 16, 2024 13:01
@pitrou
pitrou enabled auto-merge (squash) March 16, 2024 14:37
@pitrou
pitrou merged commit bee7e29 into python:mainMar 16, 2024
pitrou added a commit to pitrou/cpython that referenced this pull request Mar 17, 2024
---------
Co-authored-by: Antoine Pitrou <antoine@python.org>
vstinner pushed a commit to vstinner/cpython that referenced this pull request Mar 20, 2024
---------
Co-authored-by: Antoine Pitrou <antoine@python.org>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
---------
Co-authored-by: Antoine Pitrou <antoine@python.org>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
---------
Co-authored-by: Antoine Pitrou <antoine@python.org>
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