-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-112536: Add --tsan test for reasonable TSAN execution times. #116601
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
Conversation
@@ -0,0 +1,3 @@ | |||
## reference: https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions |
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.
I am going to update the list of supressions.txt when working on the CI things.
Lib/test/libregrtest/tsan.py
Outdated
'test_capi', | ||
'test_code', | ||
'test_compileall', | ||
'test_concurrent_futures', |
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.
==14799==ThreadSanitizer: starting new threads after multi-threaded fork is not supported. Dying (set die_after_fork=0 to override)
@colesbury
|
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Anyway, we should exclude some of test from the list since it takes over 1 hours :) |
I think that this setting could be the minimum setup for adding TSAN in CI.
|
Lib/test/libregrtest/cmdline.py
Outdated
@@ -333,6 +334,8 @@ def _create_parser(): | |||
help='enable Profile Guided Optimization (PGO) training') | |||
group.add_argument('--pgo-extended', action='store_true', | |||
help='enable extended PGO training (slower training)') | |||
group.add_argument('--tsan', dest='tsan', action='store_true', | |||
help='enable TSAN test') |
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.
Can you explain what "TSAN test" means here? From the rest of the diff it sounds like it's "Tests that pass in a reasonable amount of time with TSAN enabled", but that's not clear from this help string.
Lib/test/libregrtest/tsan.py
Outdated
'test_importlib', | ||
'test_io', | ||
'test_logging', | ||
'test_tuple', |
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.
I don't think test_tuple
uses threads. I don't think it's worthwhile to run tests that don't use threads, because we won't uncover anything new with TSAN.
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.
I got it; I removed more tests that are not using the thread currently.
Co-authored-by: Sam Gross <colesbury@gmail.com>
…n-tests
@@ -333,6 +334,8 @@ def _create_parser(): | |||
help='enable Profile Guided Optimization (PGO) training') | |||
group.add_argument('--pgo-extended', action='store_true', | |||
help='enable extended PGO training (slower training)') | |||
group.add_argument('--tsan', dest='tsan', action='store_true', | |||
help='run a subset of test cases that are proper for the TSAN test') |
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.
@swtaarrs It will be the more clear?
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.
Sorry, I completely missed this notification. Looks good to me :)
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 looks like a good start to me. We can build on it (edit the list of tests and suppressions) in the future.
… times. (pythongh-116601) (cherry picked from commit ebf29b3) Co-authored-by: Donghee Na <donghee.na@python.org>
GH-116929 is a backport of this pull request to the 3.12 branch. |
--with-thread-sanitizer
#112536📚 Documentation preview 📚: https://cpython-previews--116601.org.readthedocs.build/