Skip to content

Commit a23aecc

Browse files
[3.11] Fix ProgramPriorityTests on FreeBSD with high nice value (GH-100145) (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 <[email protected]>
1 parent 6fbc610 commit a23aecc

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
@@ -3325,7 +3325,8 @@ def test_set_get_priority(self):
33253325
os.setpriority(os.PRIO_PROCESS, os.getpid(), base + 1)
33263326
try:
33273327
new_prio = os.getpriority(os.PRIO_PROCESS, os.getpid())
3328-
if base >= 19 and new_prio <= 19:
3328+
# nice value cap is 19 for linux and 20 for FreeBSD
3329+
if base >= 19 and new_prio <= base:
33293330
raise unittest.SkipTest("unable to reliably test setpriority "
33303331
"at current nice level of %s" % base)
33313332
else:

0 commit comments

Comments
 (0)