From c408a8b604a1aaf9e2d5e661a72526037b1a71fa Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 8 Jul 2023 17:34:52 +0200 Subject: [PATCH] Fix GH-11630: proc_nice_basic.phpt only works at certain nice levels Closes GH-11635. --- ext/standard/tests/general_functions/proc_nice_basic.phpt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/standard/tests/general_functions/proc_nice_basic.phpt b/ext/standard/tests/general_functions/proc_nice_basic.phpt index 17bca0f7b75fe..55622eaf46b48 100644 --- a/ext/standard/tests/general_functions/proc_nice_basic.phpt +++ b/ext/standard/tests/general_functions/proc_nice_basic.phpt @@ -30,7 +30,9 @@ if ($exit_code !== 0) { $niceBefore = getNice($pid); proc_nice($delta); $niceAfter = getNice($pid); - var_dump($niceBefore == ($niceAfter - $delta)); + // The maximum niceness level is 19, if the process is already running at a high niceness, it cannot be increased. + // Decreasing is only possible for superusers. + var_dump(min($niceBefore + $delta, 19) == $niceAfter); ?> --EXPECT-- bool(true)