Skip to content

Commit 56d0f9a

Browse files
authored
gh-117657: Skip some tests when running with TSAN (gh-131555)
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.
1 parent b92ee14 commit 56d0f9a

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

Lib/test/test__interpchannels.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import time
77
import unittest
88

9-
from test.support import import_helper
9+
from test.support import import_helper, skip_if_sanitizer
1010

1111
_channels = import_helper.import_module('_interpchannels')
1212
from test.support.interpreters import _crossinterp
@@ -365,6 +365,7 @@ def test_shareable(self):
365365
#self.assertIsNot(got, obj)
366366

367367

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

370371
def test_create_cid(self):

Lib/test/test__interpreters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ def test_unique_id(self):
365365

366366
self.assertEqual(len(seen), 100)
367367

368+
@support.skip_if_sanitizer('gh-129824: race on tp_flags', thread=True)
368369
def test_in_thread(self):
369370
lock = threading.Lock()
370371
id = None

Lib/test/test_capi/test_misc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,7 @@ def run_tasks():
14111411
self.assertNotIn(task.requester_tid, runner_tids)
14121412

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

Lib/test/test_faulthandler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ def test_fatal_error_c_thread(self):
227227
func='faulthandler_fatal_error_thread',
228228
py_fatal_error=True)
229229

230+
@support.skip_if_sanitizer("TSAN itercepts SIGABRT", thread=True)
230231
def test_sigabrt(self):
231232
self.check_fatal_error("""
232233
import faulthandler
@@ -238,6 +239,7 @@ def test_sigabrt(self):
238239

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

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

264267
@unittest.skipIf(_testcapi is None, 'need _testcapi')
265268
@unittest.skipUnless(hasattr(signal, 'SIGILL'), 'need signal.SIGILL')
269+
@support.skip_if_sanitizer("TSAN itercepts SIGILL", thread=True)
266270
@skip_segfault_on_android
267271
def test_sigill(self):
268272
self.check_fatal_error("""

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy