Skip to content

Commit

Permalink
Fix ProgramPriorityTests on FreeBSD with high nice value (pythonGH-10…
Browse files Browse the repository at this point in the history
…0145)

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.
  • Loading branch information
AMDmi3 authored and diegorusso committed Apr 17, 2024
1 parent 7a89a49 commit b81dcaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -3511,7 +3511,8 @@ def test_set_get_priority(self):
os.setpriority(os.PRIO_PROCESS, os.getpid(), base + 1)
try:
new_prio = os.getpriority(os.PRIO_PROCESS, os.getpid())
if base >= 19 and new_prio <= 19:
# nice value cap is 19 for linux and 20 for FreeBSD
if base >= 19 and new_prio <= base:
raise unittest.SkipTest("unable to reliably test setpriority "
"at current nice level of %s" % base)
else:
Expand Down

0 comments on commit b81dcaf

Please sign in to comment.