diff options
author | Dmitry Marakasov <amdmi3@amdmi3.ru> | 2024-02-17 14:54:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-17 14:54:47 (GMT) |
commit | 437924465de5cb81988d1e580797b07090c26a28 (patch) | |
tree | 97646a53f83366eb1389b842d9f93bece674ee80 /Lib | |
parent | 265548a4eaaebc3fb379f85f2a919848927f09e5 (diff) | |
download | cpython-437924465de5cb81988d1e580797b07090c26a28.zip cpython-437924465de5cb81988d1e580797b07090c26a28.tar.gz cpython-437924465de5cb81988d1e580797b07090c26a28.tar.bz2 |
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.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_os.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 2c8823a..ce77849 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -3511,7 +3511,8 @@ class ProgramPriorityTests(unittest.TestCase): 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: |