-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Repeat JIT tests #12495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repeat JIT tests #12495
Changes from 6 commits
35c0183
2813621
7d0f061
d8997a5
ce13272
7c02611
5c12927
8f64c9e
596d31a
3bdc28b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ runs: | |
export TEST_PHP_JUNIT=junit.out.xml | ||
export STACK_LIMIT_DEFAULTS_CHECK=1 | ||
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ | ||
${{ inputs.jitType == 'disable' && '' || '--repeat 2' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CircleCI already tests with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue with combining |
||
-d opcache.jit=${{ inputs.jitType }} \ | ||
-d opcache.protect_memory=1 \ | ||
-d opcache.jit_buffer_size=64M \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
register_shutdown_function(function () { | ||
$status = opcache_get_status(false); | ||
var_dump($status); | ||
|
||
if ($status["memory_usage"]["free_memory"] < 10*1024*1024) { | ||
echo "Not enough free opcache memory!".PHP_EOL; | ||
} | ||
if ($status["interned_strings_usage"]["free_memory"] < 1*1024*1024) { | ||
echo "Not enough free interned strings memory!".PHP_EOL; | ||
} | ||
if ($status["jit"]["buffer_free"] < 10*1024*1024) { | ||
echo "Not enough free JIT memory!".PHP_EOL; | ||
} | ||
if (!$status["jit"]["on"]) { | ||
echo "JIT is not enabled!".PHP_EOL; | ||
} | ||
|
||
unset($status); | ||
gc_collect_cycles(); | ||
}); | ||
|
||
$argc--; | ||
array_shift($argv); | ||
|
||
$_SERVER['argc']--; | ||
array_shift($_SERVER['argv']); | ||
|
||
require $argv[0]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,26 +46,17 @@ function get_matrix_include(array $branches) { | |
$jobs = []; | ||
foreach ($branches as $branch) { | ||
$jobs[] = [ | ||
'name' => '_ASAN_UBSAN', | ||
'name' => '_ASAN_UBSAN_REPEAT', | ||
'branch' => $branch, | ||
'debug' => true, | ||
'zts' => true, | ||
'configuration_parameters' => "CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address'", | ||
'run_tests_parameters' => '--asan', | ||
'test_function_jit' => false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that function JIT was specifically disabled on ASAN because it exceeded the 6h limit on GitHub Actions. |
||
'timeout_minutes' => 3600, | ||
'test_function_jit' => true, | ||
'asan' => true, | ||
]; | ||
if ($branch['ref'] !== 'PHP-8.0') { | ||
$jobs[] = [ | ||
'name' => '_REPEAT', | ||
'branch' => $branch, | ||
'debug' => true, | ||
'zts' => false, | ||
'run_tests_parameters' => '--repeat 2', | ||
'timeout_minutes' => 360, | ||
'test_function_jit' => true, | ||
'asan' => false, | ||
]; | ||
$jobs[] = [ | ||
'name' => '_VARIATION', | ||
'branch' => $branch, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ set OPENSSL_CONF= | |
rem set SSLEAY_CONF= | ||
|
||
rem prepare for OPcache | ||
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=100000 -d opcache.jit_max_side_traces=100000 -d opcache.jit_max_exit_counters=100000 -d opcache.jit=tracing | ||
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=100000 -d opcache.jit_max_side_traces=100000 -d opcache.jit_max_exit_counters=100000 -d opcache.jit=tracing --repeat 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, I don't think |
||
rem work-around for failing to dl(mysqli) with OPcache (https://github.com/php/php-src/issues/8508) | ||
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=%OPCACHE_OPTS% -d extension=mysqli | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -364,7 +364,9 @@ jobs: | |
run: | | ||
echo zend_extension=opcache.so > /etc/php.d/opcache.ini | ||
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini | ||
echo opcache.enable=1 >> /etc/php.d/opcache.ini | ||
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini | ||
echo opcache.jit=tracing >> /etc/php.d/opcache.ini | ||
echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini | ||
echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini | ||
echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini | ||
|
@@ -373,8 +375,45 @@ jobs: | |
echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini | ||
echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini | ||
echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini | ||
echo opcache.jit_blacklist_root_trace=255 >> /etc/php.d/opcache.ini | ||
echo opcache.jit_blacklist_side_trace=255 >> /etc/php.d/opcache.ini | ||
echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini | ||
echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini | ||
echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini | ||
echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini | ||
echo memory_limit=-1 >> /etc/php.d/opcache.ini | ||
php -v | ||
- name: Test Infection | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think your PRs still do too much at a time 🙂 E.g. just adding Infection without |
||
if: matrix.branch.ref != 'PHP-8.0' | ||
run: | | ||
git clone https://github.com/infection/infection --branch=master --depth 1 | ||
cd infection | ||
git rev-parse HEAD | ||
export ASAN_OPTIONS=exitcode=139 | ||
php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || exit $? | ||
- name: Test Psalm | ||
if: matrix.branch.ref != 'PHP-8.0' | ||
run: | | ||
git clone https://github.com/vimeo/psalm --branch=master --depth 1 | ||
cd psalm | ||
git rev-parse HEAD | ||
export ASAN_OPTIONS=exitcode=139 | ||
# Needed to avoid overwriting JIT config | ||
export PSALM_ALLOW_XDEBUG=1 | ||
php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
php $GITHUB_WORKSPACE/.github/jit_check.php ./psalm --no-cache || exit $? | ||
- name: Test PHPStan | ||
if: matrix.branch.ref != 'PHP-8.0' | ||
run: | | ||
git clone https://github.com/phpstan/phpstan-src --depth 1 | ||
cd phpstan-src | ||
git rev-parse HEAD | ||
sed -E 's/phpVersion(.*)max[^)]+/phpVersion\1max(89999/g' conf/parametersSchema.neon -i | ||
php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
export ASAN_OPTIONS=exitcode=139 | ||
php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan clear-result-cache | ||
php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan || exit $? | ||
- name: Test AMPHP | ||
if: matrix.branch.ref != 'PHP-8.0' | ||
run: | | ||
|
@@ -387,7 +426,7 @@ jobs: | |
git rev-parse HEAD | ||
php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
export ASAN_OPTIONS=exitcode=139 | ||
vendor/bin/phpunit || EXIT_CODE=$? | ||
php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? | ||
if [ ${EXIT_CODE:-0} -gt 128 ]; then | ||
X=1; | ||
fi | ||
|
@@ -404,7 +443,7 @@ jobs: | |
# Hack to disable a test that hangs | ||
php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("*/\n public function testSharedGet()", "* @group skip\n */\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);' | ||
export ASAN_OPTIONS=exitcode=139 | ||
php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? | ||
php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? | ||
if [ ${EXIT_CODE:-0} -gt 128 ]; then | ||
exit 1 | ||
fi | ||
|
@@ -420,7 +459,7 @@ jobs: | |
git rev-parse HEAD | ||
php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
export ASAN_OPTIONS=exitcode=139 | ||
vendor/bin/phpunit || EXIT_CODE=$? | ||
php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? | ||
if [ $[EXIT_CODE:-0} -gt 128 ]; then | ||
X=1; | ||
fi | ||
|
@@ -435,7 +474,7 @@ jobs: | |
git rev-parse HEAD | ||
php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
export ASAN_OPTIONS=exitcode=139 | ||
vendor/bin/phpunit || EXIT_CODE=$? | ||
php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? | ||
if [ ${EXIT_CODE:-0} -gt 128 ]; then | ||
exit 1 | ||
fi | ||
|
@@ -455,12 +494,22 @@ jobs: | |
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999 | ||
X=0 | ||
for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do | ||
php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? | ||
php $GITHUB_WORKSPACE/.github/jit_check.php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? | ||
if [ ${EXIT_CODE:-0} -gt 128 ]; then | ||
X=1; | ||
fi | ||
done | ||
exit $X | ||
- name: Test PHPSeclib | ||
if: always() | ||
run: | | ||
git clone https://github.com/phpseclib/phpseclib --depth 1 | ||
cd phpseclib | ||
git rev-parse HEAD | ||
export ASAN_OPTIONS=exitcode=139 | ||
export PHPSECLIB_ALLOW_JIT=1 | ||
php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? | ||
- name: Test PHPUnit | ||
if: always() | ||
run: | | ||
|
@@ -469,7 +518,7 @@ jobs: | |
git rev-parse HEAD | ||
export ASAN_OPTIONS=exitcode=139 | ||
php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
php ./phpunit || EXIT_CODE=$? | ||
php $GITHUB_WORKSPACE/.github/jit_check.php ./phpunit || EXIT_CODE=$? | ||
if [ ${EXIT_CODE:-0} -gt 128 ]; then | ||
exit 1 | ||
fi | ||
|
@@ -493,7 +542,7 @@ jobs: | |
sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php | ||
sed -i 's/yourusernamehere/root/g' wp-tests-config.php | ||
sed -i 's/yourpasswordhere/root/g' wp-tests-config.php | ||
php vendor/bin/phpunit || EXIT_CODE=$? | ||
php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? | ||
if [ $EXIT_CODE -gt 128 ]; then | ||
exit 1 | ||
fi | ||
|
Uh oh!
There was an error while loading. Please reload this page.