-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
OS-linuxextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dir
Description
On glibc, posix_spawnattr_setschedpolicy
cannot change the policy to SCHED_BATCH
, even if that is the current policy.
$ 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)
If the current scheduling policy for the target process is not
SCHED_FIFO
,SCHED_RR
, [or SCHED_SPORADIC,] the result is implementation-defined; this case includes theSCHED_OTHER
policy.
AFAICS, the test should be skipped for platform.libc_ver()[0] == 'glibc'
if os.sched_getscheduler
returned os.SCHED_BATCH
, os.SCHED_IDLE
, or os.SCHED_DEADLINE
.
Linked PRs
Metadata
Metadata
Assignees
Labels
OS-linuxextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dir