$ chrt -b 0 ./python -m test test_posix -m '*scheduler*' -v
[...]
======================================================================
ERROR: test_setscheduler_with_policy (test.test_posix.TestPosixSpawn.test_setscheduler_with_policy)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/encukou/dev/cpython/Lib/test/test_posix.py", line 2048, in test_setscheduler_with_policy
pid = self.spawn_func(
sys.executable,
...<2 lines>...
scheduler=(policy, os.sched_param(priority))
)
OSError: [Errno 22] Invalid argument
[same in test.test_posix.TestPosixSpawnP]
FAILED (errors=2)
On glibc,
posix_spawnattr_setschedpolicycannot change the policy toSCHED_BATCH, even if that is the current policy.POSIX says:
AFAICS, the test should be skipped for
platform.libc_ver()[0] == 'glibc'ifos.sched_getschedulerreturnedos.SCHED_BATCH,os.SCHED_IDLE, oros.SCHED_DEADLINE.Linked PRs
SCHED_BATCH#138576SCHED_BATCHon glibc (GH-138576) #138819SCHED_BATCHon glibc (GH-138576) #138820