From 732ab54e2623f127e695e571dd8ab6d54c93fc53 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Mon, 15 Jul 2024 16:43:51 -0400 Subject: [PATCH] gh-117657: Skip tests that fork with threads under TSan (GH-121599) This avoids messages like: ThreadSanitizer: starting new threads after multi-threaded fork is not supported. Dying (set die_after_fork=0 to override) (cherry picked from commit 82a4dac9f6131954c32dac9d0277283fc5b499a9) Co-authored-by: Sam Gross --- Lib/test/test_logging.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 4223d10e79117c..2b7e692616a473 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -3971,6 +3971,7 @@ def test_config_queue_handler_invalid_config_does_not_create_multiprocessing_man ) manager.assert_not_called() + @skip_if_tsan_fork @support.requires_subprocess() def test_multiprocessing_queues(self): # See gh-119819 @@ -4283,6 +4284,7 @@ def test_queue_listener_with_multiple_handlers(self): import multiprocessing from unittest.mock import patch + @skip_if_tsan_fork @threading_helper.requires_working_threading() class QueueListenerTest(BaseTest): """ @@ -5183,6 +5185,7 @@ def _extract_logrecord_process_name(key, logMultiprocessing, conn=None): else: return results + @skip_if_tsan_fork def test_multiprocessing(self): support.skip_if_broken_multiprocessing_synchronize() multiprocessing_imported = 'multiprocessing' in sys.modules