summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 3b5c37c..9769cb4 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -50,6 +50,11 @@ def skip_unless_reliable_fork(test):
return test
+skip_if_tsan_fork = unittest.skipIf(
+ support.check_sanitizer(thread=True),
+ "TSAN doesn't support threads after fork")
+
+
def requires_subinterpreters(meth):
"""Decorator to skip a test if subinterpreters are not supported."""
return unittest.skipIf(interpreters is None,
@@ -634,6 +639,7 @@ class ThreadTests(BaseTestCase):
self.assertTrue(t.daemon)
@skip_unless_reliable_fork
+ @skip_if_tsan_fork
def test_dummy_thread_after_fork(self):
# Issue #14308: a dummy thread in the active list doesn't mess up
# the after-fork mechanism.
@@ -703,6 +709,7 @@ class ThreadTests(BaseTestCase):
@skip_unless_reliable_fork
@unittest.skipUnless(hasattr(os, 'waitpid'), "test needs os.waitpid()")
+ @skip_if_tsan_fork
def test_main_thread_after_fork(self):
code = """if 1:
import os, threading
@@ -1271,6 +1278,7 @@ class ThreadJoinOnShutdown(BaseTestCase):
self._run_and_join(script)
@skip_unless_reliable_fork
+ @skip_if_tsan_fork
def test_3_join_in_forked_from_thread(self):
# Like the test above, but fork() was called from a worker thread
# In the forked process, the main Thread object must be marked as stopped.