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.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 00d9e59..119b41f 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -47,6 +47,8 @@ def skip_unless_reliable_fork(test):
return unittest.skip("due to known OS bug related to thread+fork")(test)
if support.HAVE_ASAN_FORK_BUG:
return unittest.skip("libasan has a pthread_create() dead lock related to thread+fork")(test)
+ if support.check_sanitizer(thread=True):
+ return unittest.skip("TSAN doesn't support threads after fork")
return test
@@ -384,6 +386,10 @@ class ThreadTests(BaseTestCase):
# Issue 1402: the PyGILState_Ensure / _Release functions may be called
# very late on python exit: on deallocation of a running thread for
# example.
+ if support.check_sanitizer(thread=True):
+ # the thread running `time.sleep(100)` below will still be alive
+ # at process exit
+ self.skipTest("TSAN would report thread leak")
import_module("ctypes")
rc, out, err = assert_python_failure("-c", """if 1:
@@ -416,6 +422,11 @@ class ThreadTests(BaseTestCase):
def test_finalize_with_trace(self):
# Issue1733757
# Avoid a deadlock when sys.settrace steps into threading._shutdown
+ if support.check_sanitizer(thread=True):
+ # the thread running `time.sleep(2)` below will still be alive
+ # at process exit
+ self.skipTest("TSAN would report thread leak")
+
assert_python_ok("-c", """if 1:
import sys, threading
@@ -1223,6 +1234,11 @@ class ThreadJoinOnShutdown(BaseTestCase):
# Check that a daemon thread cannot crash the interpreter on shutdown
# by manipulating internal structures that are being disposed of in
# the main thread.
+ if support.check_sanitizer(thread=True):
+ # some of the threads running `random_io` below will still be alive
+ # at process exit
+ self.skipTest("TSAN would report thread leak")
+
script = """if True:
import os
import random