Skip to content

Commit 4f044e9

Browse files
divinity76mvorisek
authored andcommitted
support running testsuite with negative niceness (#11481)
* support running testsuite with negative niceness a bug in the regex would break getNice() if the current niceness was negative, which would make the whole test fail. Previously: this would fail: time sudo nice --adjustment=-19 ./php run-tests.php -j$(nproc) -x --offline ext/standard/tests/general_functions/proc_nice_basic.phpt --color --show-all and this would work: time sudo ./php run-tests.php -j$(nproc) -x --offline ext/standard/tests/general_functions/proc_nice_basic.phpt --color --show-all * Update ext/standard/tests/general_functions/proc_nice_basic.phpt Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz> --------- Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
1 parent 181598d commit 4f044e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/tests/general_functions/proc_nice_basic.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if ($exit_code !== 0) {
1919
function getNice($id)
2020
{
2121
$res = shell_exec('ps -p ' . $id .' -o "pid,nice"');
22-
preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches);
22+
preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(-?\d+)/m', $res, $matches);
2323
if (count($matches) > 2)
2424
return $matches[2];
2525
else

0 commit comments

Comments
 (0)