From a3f1610fa250417cc3a18641a56746abe2d35b87 Mon Sep 17 00:00:00 2001 From: Furkan Onder Date: Thu, 17 Oct 2024 00:48:49 +0300 Subject: [PATCH 1/3] Increase wait time for NetBSD in check_resource_tracker_death --- Lib/test/_test_multiprocessing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index a059a6b8340448..883d447bec9014 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5730,7 +5730,10 @@ def check_resource_tracker_death(self, signum, should_die): pid = _resource_tracker._pid os.kill(pid, signum) - time.sleep(1.0) # give it time to die + if sys.platform.startswith("netbsd") and should_die: + time.sleep(60.0 * 3) # give it more time to die on netbsd + else: + time.sleep(1.0) # give it more time to die ctx = multiprocessing.get_context("spawn") with warnings.catch_warnings(record=True) as all_warn: From e82a202f600bc8dd48a6ed6addf7644a664b1b44 Mon Sep 17 00:00:00 2001 From: Furkan Onder Date: Fri, 18 Oct 2024 02:01:20 +0300 Subject: [PATCH 2/3] Skip test_resource_tracker_sigkill on NetBSD --- Lib/test/_test_multiprocessing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 883d447bec9014..1627e8f01a2dbd 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5764,6 +5764,8 @@ def test_resource_tracker_sigterm(self): # Catchable signal (ignored by semaphore tracker) self.check_resource_tracker_death(signal.SIGTERM, False) + @unittest.skipIf(sys.platform.startswith("netbsd"), + "gh-125620: Skip on NetBSD due to long wait for SIGKILL process termination.") def test_resource_tracker_sigkill(self): # Uncatchable signal. self.check_resource_tracker_death(signal.SIGKILL, True) From d2e3bb6109d5e7273ca84c31c8b57e9ae88e08f1 Mon Sep 17 00:00:00 2001 From: Furkan Onder Date: Fri, 18 Oct 2024 02:04:07 +0300 Subject: [PATCH 3/3] Revert: Increase wait time for NetBSD in check_resource_tracker_death --- Lib/test/_test_multiprocessing.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 1627e8f01a2dbd..065fc27b770438 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5730,10 +5730,7 @@ def check_resource_tracker_death(self, signum, should_die): pid = _resource_tracker._pid os.kill(pid, signum) - if sys.platform.startswith("netbsd") and should_die: - time.sleep(60.0 * 3) # give it more time to die on netbsd - else: - time.sleep(1.0) # give it more time to die + time.sleep(1.0) # give it time to die ctx = multiprocessing.get_context("spawn") with warnings.catch_warnings(record=True) as all_warn: