From 807dfd46d853117fb7517c8069652d6866dfe2d7 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Sat, 10 Feb 2024 21:04:50 -0500 Subject: [PATCH 1/4] gh-115258: Temporarily disable test on free-threaded Windows build The "test_shutdown_all_methods_in_many_threads" test times out on the Windows free-threaded CI. This skips the test on that platform and configuration until we figure out the root cause. --- Lib/test/test_queue.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py index e3d4d566cdda48..65386721b5ab02 100644 --- a/Lib/test/test_queue.py +++ b/Lib/test/test_queue.py @@ -2,6 +2,7 @@ # to ensure the Queue locks remain stable. import itertools import random +import sys import threading import time import unittest @@ -9,6 +10,7 @@ from test.support import gc_collect from test.support import import_helper from test.support import threading_helper +from test.support import Py_GIL_DISABLED # queue module depends on threading primitives threading_helper.requires_working_threading(module=True) @@ -402,6 +404,8 @@ def _shutdown_all_methods_in_many_threads(self, immediate): for thread in ps[1:]: thread.join() + @unittest.skipIf(sys.platform == 'win32' and Py_GIL_DISABLED, + "test times out (gh-115258)") def test_shutdown_all_methods_in_many_threads(self): return self._shutdown_all_methods_in_many_threads(False) From 9ba3d906f2be3aa30910161680d6324a88052031 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Sat, 10 Feb 2024 21:22:46 -0500 Subject: [PATCH 2/4] Skip another test --- Lib/test/test_queue.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py index 65386721b5ab02..e041988f668055 100644 --- a/Lib/test/test_queue.py +++ b/Lib/test/test_queue.py @@ -409,6 +409,8 @@ def _shutdown_all_methods_in_many_threads(self, immediate): def test_shutdown_all_methods_in_many_threads(self): return self._shutdown_all_methods_in_many_threads(False) + @unittest.skipIf(sys.platform == 'win32' and Py_GIL_DISABLED, + "test times out (gh-115258)") def test_shutdown_immediate_all_methods_in_many_threads(self): return self._shutdown_all_methods_in_many_threads(True) From 09bd7cbd55b23be60e7ae52cfc25fb6ced8d27a2 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Sat, 10 Feb 2024 21:55:15 -0500 Subject: [PATCH 3/4] Skip test on Windows (not just free-threaded build) --- Lib/test/test_queue.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py index e041988f668055..946f0972397d37 100644 --- a/Lib/test/test_queue.py +++ b/Lib/test/test_queue.py @@ -10,7 +10,6 @@ from test.support import gc_collect from test.support import import_helper from test.support import threading_helper -from test.support import Py_GIL_DISABLED # queue module depends on threading primitives threading_helper.requires_working_threading(module=True) @@ -404,13 +403,11 @@ def _shutdown_all_methods_in_many_threads(self, immediate): for thread in ps[1:]: thread.join() - @unittest.skipIf(sys.platform == 'win32' and Py_GIL_DISABLED, - "test times out (gh-115258)") + @unittest.skipIf(sys.platform == 'win32', "test times out (gh-115258)") def test_shutdown_all_methods_in_many_threads(self): return self._shutdown_all_methods_in_many_threads(False) - @unittest.skipIf(sys.platform == 'win32' and Py_GIL_DISABLED, - "test times out (gh-115258)") + @unittest.skipIf(sys.platform == 'win32', "test times out (gh-115258)") def test_shutdown_immediate_all_methods_in_many_threads(self): return self._shutdown_all_methods_in_many_threads(True) From 48356a8348785c8553ff3f0c1c10724e36c7bfda Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Sat, 10 Feb 2024 21:57:05 -0500 Subject: [PATCH 4/4] Use consistent quote style --- Lib/test/test_queue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py index 946f0972397d37..d308a212999429 100644 --- a/Lib/test/test_queue.py +++ b/Lib/test/test_queue.py @@ -403,11 +403,11 @@ def _shutdown_all_methods_in_many_threads(self, immediate): for thread in ps[1:]: thread.join() - @unittest.skipIf(sys.platform == 'win32', "test times out (gh-115258)") + @unittest.skipIf(sys.platform == "win32", "test times out (gh-115258)") def test_shutdown_all_methods_in_many_threads(self): return self._shutdown_all_methods_in_many_threads(False) - @unittest.skipIf(sys.platform == 'win32', "test times out (gh-115258)") + @unittest.skipIf(sys.platform == "win32", "test times out (gh-115258)") def test_shutdown_immediate_all_methods_in_many_threads(self): return self._shutdown_all_methods_in_many_threads(True)