diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4dec0f4027745..f75b6dc150e40 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,22 +12,26 @@ trigger: - UPGRADING.INTERNALS jobs: - - template: azure/job.yml + - template: azure/file_cache_job.yml parameters: - configurationName: DEBUG_NTS - configurationParameters: '--enable-debug --disable-zts' - - template: azure/job.yml - parameters: - configurationName: RELEASE_ZTS - configurationParameters: '--disable-debug --enable-zts' - - template: azure/i386/job.yml - parameters: - configurationName: I386_DEBUG_ZTS - configurationParameters: '--enable-debug --enable-zts' - - template: azure/macos/job.yml - parameters: - configurationName: MACOS_DEBUG_NTS + configurationName: DEBUG_NTS_FILE_CACHE configurationParameters: '--enable-debug --disable-zts' + # - template: azure/job.yml + # parameters: + # configurationName: DEBUG_NTS + # configurationParameters: '--enable-debug --disable-zts' + # - template: azure/job.yml + # parameters: + # configurationName: RELEASE_ZTS + # configurationParameters: '--disable-debug --enable-zts' + # - template: azure/i386/job.yml + # parameters: + # configurationName: I386_DEBUG_ZTS + # configurationParameters: '--enable-debug --enable-zts' + # - template: azure/macos/job.yml + # parameters: + # configurationName: MACOS_DEBUG_NTS + # configurationParameters: '--enable-debug --disable-zts' - ${{ if eq(variables['Build.Reason'], 'Schedule') }}: - template: azure/job.yml parameters: diff --git a/azure/file_cache_job.yml b/azure/file_cache_job.yml new file mode 100644 index 0000000000000..a52b56a2163c9 --- /dev/null +++ b/azure/file_cache_job.yml @@ -0,0 +1,60 @@ +parameters: + configurationName: '' + configurationParameters: '' + runTestsParameters: '' + timeoutInMinutes: 60 + +jobs: + - job: ${{ parameters.configurationName }} + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + pool: + vmImage: 'ubuntu-18.04' + steps: + - template: apt.yml + - template: configure.yml + parameters: + configurationParameters: ${{ parameters.configurationParameters }} + - script: make -j$(/usr/bin/nproc) >/dev/null + displayName: 'Make Build' + - template: install.yml + - script: | + set -e + sudo service mysql start + mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" + sudo -u postgres psql -c "CREATE DATABASE test;" + displayName: 'Setup' + - template: test.yml + parameters: + configurationName: ${{ parameters.configurationName }} + runTestsName: 'File Cache (prime)' + runTestsParameters: >- + ${{ parameters.runTestsParameters }} + -d zend_extension=opcache.so + --file-cache-prime + - template: test.yml + parameters: + configurationName: ${{ parameters.configurationName }} + runTestsName: 'File Cache (use)' + runTestsParameters: >- + ${{ parameters.runTestsParameters }} + -d zend_extension=opcache.so + --file-cache-use + - template: test.yml + parameters: + configurationName: ${{ parameters.configurationName }} + runTestsName: 'File Cache Only (prime)' + runTestsParameters: >- + ${{ parameters.runTestsParameters }} + -d zend_extension=opcache.so + --file-cache-prime + -d opcache.file_cache_only=1 + - template: test.yml + parameters: + configurationName: ${{ parameters.configurationName }} + runTestsName: 'File Cache Only (use)' + runTestsParameters: >- + ${{ parameters.runTestsParameters }} + -d zend_extension=opcache.so + --file-cache-use + -d opcache.file_cache_only=1 diff --git a/ext/ffi/tests/300.phpt b/ext/ffi/tests/300.phpt index 8cf68736be46d..fd81498026669 100644 --- a/ext/ffi/tests/300.phpt +++ b/ext/ffi/tests/300.phpt @@ -10,6 +10,7 @@ opcache.enable=1 opcache.enable_cli=1 opcache.optimization_level=-1 opcache.preload={PWD}/preload.inc +opcache.file_cache_only=0 --FILE-- --ENV-- diff --git a/ext/phar/tests/tar/create_new_and_modify.phpt b/ext/phar/tests/tar/create_new_and_modify.phpt index 355b69399eddf..75cb537aa828b 100644 --- a/ext/phar/tests/tar/create_new_and_modify.phpt +++ b/ext/phar/tests/tar/create_new_and_modify.phpt @@ -4,6 +4,7 @@ Phar: create and modify tar-based phar --INI-- phar.readonly=0 +opcache.validate_timestamps=1 --FILE-- --INI-- phar.readonly=0 +opcache.validate_timestamps=1 --FILE-- \n" . get_summary(false, true)); @@ -1272,10 +1284,18 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS function run_all_tests($test_files, $env, $redir_tested = null) { - global $test_results, $failed_tests_file, $result_tests_file, $php, $test_idx; + global $test_results, $failed_tests_file, $result_tests_file, $php, $test_idx, $file_cache; // Parallel testing global $PHP_FAILED_TESTS, $workers, $workerID, $workerSock; + if ($file_cache !== null) { + /* Automatically skip opcache tests in --file-cache mode, + * because opcache generally doesn't expect those to run under file cache */ + $test_files = array_filter($test_files, function($test) { + return !is_string($test) || false === strpos($test, 'ext/opcache'); + }); + } + /* Ignore -jN if there is only one file to analyze. */ if ($workers !== null && count($test_files) > 1 && !$workerID) { run_all_tests_parallel($test_files, $env, $redir_tested); @@ -1763,7 +1783,7 @@ function run_test($php, $file, $env) global $SHOW_ONLY_GROUPS; global $no_file_cache; global $slow_min_ms; - global $preload; + global $preload, $file_cache; // Parallel testing global $workerID; $temp_filenames = null; @@ -2087,9 +2107,9 @@ function run_test($php, $file, $env) $ext_params = array(); settings2array($ini_overwrites, $ext_params); $ext_params = settings2params($ext_params); - $ext_dir = `$php $pass_options $extra_options $ext_params -d display_errors=0 -r "echo ini_get('extension_dir');"`; + $ext_dir = `$php $pass_options $extra_options $ext_params $no_file_cache -d display_errors=0 -r "echo ini_get('extension_dir');"`; $extensions = preg_split("/[\n\r]+/", trim($section_text['EXTENSIONS'])); - $loaded = explode(",", `$php $pass_options $extra_options $ext_params -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`); + $loaded = explode(",", `$php $pass_options $extra_options $ext_params $no_file_cache -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`); $ext_prefix = IS_WINDOWS ? "php_" : ""; foreach ($extensions as $req_ext) { if (!in_array($req_ext, $loaded)) { @@ -2108,6 +2128,19 @@ function run_test($php, $file, $env) $orig_ini_settings = settings2params($ini_settings); + if ($file_cache !== null) { + $ini_settings['opcache.file_cache'] = '/tmp'; + // Make sure warnings still show up on the second run. + $ini_settings['opcache.record_warnings'] = '1'; + // File cache is currently incompatible with JIT. + $ini_settings['opcache.jit'] = '0'; + if ($file_cache === 'use') { + // Disable timestamp validation in order to fetch from file cache, + // even though all the files are re-created. + $ini_settings['opcache.validate_timestamps'] = '0'; + } + } + // Any special ini settings // these may overwrite the test defaults... if (array_key_exists('INI', $section_text)) { diff --git a/sapi/phpdbg/tests/info_001.phpt b/sapi/phpdbg/tests/info_001.phpt index 2f38fd36af6b1..28078557095d6 100644 --- a/sapi/phpdbg/tests/info_001.phpt +++ b/sapi/phpdbg/tests/info_001.phpt @@ -48,7 +48,7 @@ prompt> ------------------------------------------------ Function Breakpoints: #0 foo prompt> [User-defined constants (0)] -prompt> [Included files: 0] +prompt> [Included files: %d]%A prompt> [No error found!] prompt> [Literal Constants in foo() (2)] |-------- C0 -------> [var_dump]