mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02: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:
parent
181598d403
commit
4f044e9238
1 changed files with 1 additions and 1 deletions
|
@ -19,7 +19,7 @@ if ($exit_code !== 0) {
|
||||||
function getNice($id)
|
function getNice($id)
|
||||||
{
|
{
|
||||||
$res = shell_exec('ps -p ' . $id .' -o "pid,nice"');
|
$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)
|
if (count($matches) > 2)
|
||||||
return $matches[2];
|
return $matches[2];
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue