mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
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>
This commit is contained in:
@@ -19,7 +19,7 @@ if ($exit_code !== 0) {
|
||||
function getNice($id)
|
||||
{
|
||||
$res = shell_exec('ps -p ' . $id .' -o "pid,nice"');
|
||||
preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches);
|
||||
preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(-?\d+)/m', $res, $matches);
|
||||
if (count($matches) > 2)
|
||||
return $matches[2];
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user