From: jxes993409 <68891412+jxes993409@users.noreply.github.com> Date: Fri, 12 Sep 2025 09:37:53 +0000 (+0800) Subject: gh-138163: skip failures if tests are run with `SCHED_BATCH` on glibc (GH-138576) X-Git-Tag: v3.15.0a1~400 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=492941459acb5b5a104d96414288601d2e2b7e6f;p=thirdparty%2FPython%2Fcpython.git gh-138163: skip failures if tests are run with `SCHED_BATCH` on glibc (GH-138576) --- diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 2af11888b17c..0bb65fe717d3 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -2036,6 +2036,12 @@ class _PosixSpawnMixin: @requires_sched @unittest.skipIf(sys.platform.startswith(('freebsd', 'netbsd')), "bpo-34685: test can fail on BSD") + @unittest.skipIf(platform.libc_ver()[0] == 'glibc' and + os.sched_getscheduler(0) in [ + os.SCHED_BATCH, + os.SCHED_IDLE, + os.SCHED_DEADLINE], + "Skip test due to glibc posix_spawn policy") def test_setscheduler_with_policy(self): policy = os.sched_getscheduler(0) priority = os.sched_get_priority_min(policy)