]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118495: Skip test using threads after forking when running with TSAN (#118530)
authormpage <mpage@meta.com>
Fri, 3 May 2024 15:14:26 +0000 (08:14 -0700)
committerGitHub <noreply@github.com>
Fri, 3 May 2024 15:14:26 +0000 (11:14 -0400)
This is unsupported. Note that `skip_unless_reliable_fork()` checks for
the conditions used by the decorators that were removed, along with checking
for TSAN.

Lib/test/test_threading.py

index 0047e8a8798d4e03b1a71be3418c17be4b685689..329767aa82e336bd7aba60467d2abc7fb94e04b3 100644 (file)
@@ -49,7 +49,7 @@ def skip_unless_reliable_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 unittest.skip("TSAN doesn't support threads after fork")(test)
     return test
 
 
@@ -781,8 +781,7 @@ class ThreadTests(BaseTestCase):
                          "current is main True\n"
                          )
 
-    @unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug")
-    @support.requires_fork()
+    @skip_unless_reliable_fork
     @unittest.skipUnless(hasattr(os, 'waitpid'), "test needs os.waitpid()")
     def test_main_thread_after_fork_from_foreign_thread(self, create_dummy=False):
         code = """if 1: