8000 gh-117657: Skip some tests when running with TSAN by colesbury · Pull Request #131555 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-117657: Skip some tests when running with TSAN #131555

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

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
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
gh-117657: Skip some tests when running with TSAN
The subinterpreter tests have data races (see gh-129824).

TSAN attempts to intercept some of the fatal signals, which can lead to
bogus reports. We could possibly handle these via TSAN_OPTIONS, but it's
simpler to just skip those tests -- they're not multithreaded anyways.
  • Loading branch information
colesbury committed Mar 21, 2025
commit 39cbaa3fa99bb65533e511e247dc605955419289
3 changes: 2 additions & 1 deletion Lib/test/test__interpchannels.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import time
import unittest

from test.support import import_helper
from test.support import import_helper, skip_if_sanitizer

_channels = import_helper.import_module('_interpchannels')
from test.support.interpreters import _crossinterp
Expand Down Expand Up @@ -365,6 +365,7 @@ def test_shareable(self):
#self.asser 8000 tIsNot(got, obj)


@skip_if_sanitizer('gh-129824: race on _waiting_release', thread=True)
class ChannelTests(TestBase):

def test_create_cid(self):
Expand Down
1 change: 1 addition & 0 deletions Lib/test/test__interpreters.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def test_unique_id(self):

self.assertEqual(len(seen), 100)

@support.skip_if_sanitizer('gh-129824: race on tp_flags', thread=True)
def test_in_thread(self):
lock = threading.Lock()
id = None
Expand Down
1 change: 1 addition & 0 deletions Lib/test/test_capi/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ def run_tasks():
self.assertNotIn(task.requester_tid, runner_tids)

@requires_subinterpreters
@support.skip_if_sanitizer("gh-129824: race on assign_version_tag", thread=True)
def test_isolated_subinterpreter(self):
# We exercise the most important permutations.

Expand Down
4 changes: 4 additions & 0 deletions Lib/test/test_faulthandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def test_fatal_error_c_thread(self):
func='faulthandler_fatal_error_thread',
py_fatal_error=True)

@support.skip_if_sanitizer("TSAN itercepts SIGABRT", thread=True)
def test_sigabrt(self):
self.check_fatal_error("""
import faulthandler
Expand All @@ -238,6 +239,7 @@ def test_sigabrt(self):

@unittest.skipIf(sys.platform == 'win32',
"SIGFPE cannot be caught on Windows")
@support.skip_if_sanitizer("TSAN itercepts SIGFPE", thread=True)
def test_sigfpe(self):
self.check_fatal_error("""
import faulthandler
Expand All @@ -249,6 +251,7 @@ def test_sigfpe(self):

@unittest.skipIf(_testcapi is None, 'need _testcapi')
@unittest.skipUnless(hasattr(signal, 'SIGBUS'), 'need signal.SIGBUS')
@support.skip_if_sanitizer("TSAN itercepts SIGBUS", thread=True)
@skip_segfault_on_android
def test_sigbus(self):
self.check_fatal_error("""
Expand All @@ -263,6 +266,7 @@ def test_sigbus(self):

@unittest.skipIf(_testcapi is None, 'need _testcapi')
@unittest.skipUnless(hasattr(signal, 'SIGILL'), 'need signal.SIGILL')
@support.skip_if_sanitizer("TSAN itercepts SIGILL", thread=True)
@skip_segfault_on_android
def test_sigill(self):
self.check_fatal_error("""
Expand Down
Loading
0