Issue #12783: Fix test_posix failures on FreeBSD buildbots, due to

sched_setparam() returning EINVAL for processes with SCHED_OTHER scheduling
policy.
parent 795eaeb4
...@@ -875,8 +875,14 @@ class PosixTester(unittest.TestCase): ...@@ -875,8 +875,14 @@ class PosixTester(unittest.TestCase):
except OSError as e: except OSError as e:
if e.errno != errno.EPERM: if e.errno != errno.EPERM:
raise raise
posix.sched_setparam(0, param)
self.assertRaises(OSError, posix.sched_setparam, -1, param) # POSIX states that calling sched_setparam() on a process with a
# scheduling policy other than SCHED_FIFO or SCHED_RR is
# implementation-defined: FreeBSD returns EINVAL.
if not sys.platform.startswith('freebsd'):
posix.sched_setparam(0, param)
self.assertRaises(OSError, posix.sched_setparam, -1, param)
self.assertRaises(OSError, posix.sched_setscheduler, -1, mine, param) self.assertRaises(OSError, posix.sched_setscheduler, -1, mine, param)
self.assertRaises(TypeError, posix.sched_setscheduler, 0, mine, None) self.assertRaises(TypeError, posix.sched_setscheduler, 0, mine, None)
self.assertRaises(TypeError, posix.sched_setparam, 0, 43) self.assertRaises(TypeError, posix.sched_setparam, 0, 43)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment