https://github.com/python/cpython/commit/9563e46a783565ec72e551ff85819458a15773a3
commit: 9563e46a783565ec72e551ff85819458a15773a3
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-02-17T15:35:34Z
summary:

[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 437924465de5cb81988d1e580797b07090c26a28)

Co-authored-by: Dmitry Marakasov <[email protected]>

files:
M Lib/test/test_os.py

diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index fc58f8d2dcd7a3..94e77007e474ea 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -3490,7 +3490,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:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to