Skip to content

Commit

Permalink
[3.11] Fix ProgramPriorityTests on FreeBSD with high nice value (GH-1…
Browse files Browse the repository at this point in the history
…00145) (GH-115615)

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 <amdmi3@amdmi3.ru>
  • Loading branch information
miss-islington and AMDmi3 committed Feb 17, 2024
1 parent 6fbc610 commit a23aecc
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 @@ -3325,7 +3325,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 a23aecc

Please sign in to comment.