]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-138163: skip failures if tests are run with `SCHED_BATCH` on glibc (GH-138576)
authorjxes993409 <68891412+jxes993409@users.noreply.github.com>
Fri, 12 Sep 2025 09:37:53 +0000 (17:37 +0800)
committerGitHub <noreply@github.com>
Fri, 12 Sep 2025 09:37:53 +0000 (11:37 +0200)
Lib/test/test_posix.py

index 2af11888b17c1d5911b19ede0d29f90265cb8c45..0bb65fe717d359f5f822afa2edc34c5bcebb5d22 100644 (file)
@@ -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)