diff options
| author | Donghee Na <donghee.na@python.org> | 2024-03-16 10:10:37 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-16 10:10:37 (GMT) |
| commit | 20578a1f68c841a264b72b00591b11ab2fa77b43 (patch) | |
| tree | 71ec7f5fd087611fa232e36323b40874fa92d926 /Lib/test/test_threading.py | |
| parent | a1c4923d65a3e4cea917745e7f6bc2e377cde5c5 (diff) | |
| download | cpython-20578a1f68c841a264b72b00591b11ab2fa77b43.zip cpython-20578a1f68c841a264b72b00591b11ab2fa77b43.tar.gz cpython-20578a1f68c841a264b72b00591b11ab2fa77b43.tar.bz2 | |
gh-112536: Add TSAN builds on Github Actions (#116872)
Diffstat (limited to 'Lib/test/test_threading.py')
| -rw-r--r-- | Lib/test/test_threading.py | 8 |
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. |
