Skip to content

Commit 9563e46

Browse files
[3.12] Fix ProgramPriorityTests on FreeBSD with high nice value (GH-100145) (GH-115614)
It expects priority to be capped with 19, which is the cap for Linux, but for FreeBSD the cap is 20 and the test fails under the similar conditions. Tweak the condition to cover FreeBSD as well. (cherry picked from commit 4379244) Co-authored-by: Dmitry Marakasov <[email protected]>
1 parent e32cde5 commit 9563e46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_os.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3490,7 +3490,8 @@ def test_set_get_priority(self):
34903490
os.setpriority(os.PRIO_PROCESS, os.getpid(), base + 1)
34913491
try:
34923492
new_prio = os.getpriority(os.PRIO_PROCESS, os.getpid())
3493-
if base >= 19 and new_prio <= 19:
3493+
# nice value cap is 19 for linux and 20 for FreeBSD
3494+
if base >= 19 and new_prio <= base:
34943495
raise unittest.SkipTest("unable to reliably test setpriority "
34953496
"at current nice level of %s" % base)
34963497
else:

0 commit comments

Comments
 (0)