Skip to content

Commit 4379244

Browse files
authored
Fix ProgramPriorityTests on FreeBSD with high nice value (GH-100145)
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.
1 parent 265548a commit 4379244

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_os.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3511,7 +3511,8 @@ def test_set_get_priority(self):
35113511
os.setpriority(os.PRIO_PROCESS, os.getpid(), base + 1)
35123512
try:
35133513
new_prio = os.getpriority(os.PRIO_PROCESS, os.getpid())
3514-
if base >= 19 and new_prio <= 19:
3514+
# nice value cap is 19 for linux and 20 for FreeBSD
3515+
if base >= 19 and new_prio <= base:
35153516
raise unittest.SkipTest("unable to reliably test setpriority "
35163517
"at current nice level of %s" % base)
35173518
else:

0 commit comments

Comments
 (0)