From 38a54ae45a6f22cc70ef06d310708ae2d9b03868 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Tue, 9 Jul 2024 19:01:21 +0000 Subject: [PATCH 1/2] gh-117657: Skip test when running under TSan The ProcessPoolForkserver combined with resource_tracker starts a thread after forking, which is not supported by TSan. --- Lib/test/test_concurrent_futures/test_init.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_concurrent_futures/test_init.py b/Lib/test/test_concurrent_futures/test_init.py index a36f592b79b7cf..df640929309318 100644 --- a/Lib/test/test_concurrent_futures/test_init.py +++ b/Lib/test/test_concurrent_futures/test_init.py @@ -139,6 +139,7 @@ def _test(self, test_class): def test_spawn(self): self._test(ProcessPoolSpawnFailingInitializerTest) + @support.skip_if_sanitizer("TSAN doesn't support threads after fork", thread=True) def test_forkserver(self): self._test(ProcessPoolForkserverFailingInitializerTest) From e8020d9ad8dfbd2ec9201be0f6f2644a2fbf10b0 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Tue, 9 Jul 2024 20:34:20 +0000 Subject: [PATCH 2/2] Aslo skip test_multiprocessing_fork for the same reason --- Lib/test/test_multiprocessing_fork/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_multiprocessing_fork/__init__.py b/Lib/test/test_multiprocessing_fork/__init__.py index aa1fff50b28f5f..b35e82879d7fe2 100644 --- a/Lib/test/test_multiprocessing_fork/__init__.py +++ b/Lib/test/test_multiprocessing_fork/__init__.py @@ -12,5 +12,8 @@ if sys.platform == 'darwin': raise unittest.SkipTest("test may crash on macOS (bpo-33725)") +if support.check_sanitizer(thread=True): + raise unittest.SkipTest("TSAN doesn't support threads after fork") + def load_tests(*args): return support.load_package_tests(os.path.dirname(__file__), *args)