Repository navigation
Speed up PHPUnit and avoid E2E setup timeouts - #579
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
JanJakes
force-pushed
the
fix-e2e-browser-setup
branch
3 times, most recently
from
October 28, 2026 15:05
e7329d8 to
a6f85a1
Compare
JanJakes
marked this pull request as ready for review
October 28, 2026 15:08
Run E2E browsers in the official image matching the installed Playwright version. Use Docker Compose for readiness and a composite action for test execution and cleanup, avoiding Ubuntu package downloads. Enable CLI OPcache with a 256 MB cache for WordPress PHPUnit while preserving test diagnostics and file-change checks. Remove unused Buildx setup from the WordPress test workflows. https://playwright.dev/docs/docker#remote-connection
Use a 64 MB JIT buffer for the WordPress and SQLite plugin PHPUnit suites. Keep the existing OPcache and test settings unchanged.
JanJakes
force-pushed
the
fix-e2e-browser-setup
branch
from
October 28, 2026 15:31
a6f85a1 to
84eb24a
Compare
Merged
JanJakes
added a commit
that referenced
this pull request
Nov 3, 2026
## Release `3.1.3` Version bump and changelog update for release `3.1.3`. **Changelog draft:** * Fix `BINARY` and `VARBINARY` column defaults ([#596](#596)) * Quote SQLite identifiers in `LOCK TABLES`, `SHOW TABLES`, and compound primary key indexes ([#599](#599)) * Name lexer tokens after the MySQL grammar and default to MySQL 8.4.10 ([#607](#607)) * Fix MySQL lexer correctness issues ([#584](#584)) * Require MySQL proxy authentication and default to loopback ([#540](#540)) * Speed up PHPUnit and avoid E2E setup timeouts ([#579](#579)) * Fix reserved prefix checks for case variants and foreign keys ([#580](#580)) **Full changelog:** v3.1.2...release/v3.1.3 ## Next steps 1. **Review** the changes in this pull request. 2. **Push** any additional edits to this branch (`release/v3.1.3`). 3. **Merge** this pull request to complete the release. Merging will automatically build the plugin ZIP, create a [GitHub release](https://github.com/WordPress/sqlite-database-integration/releases), and deploy to [WordPress.org](https://wordpress.org/plugins/sqlite-database-integration/). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Improved handling of binary column defaults and SQLite identifier quoting. * Corrected MySQL lexer tokens, defaults, and lexer behavior. * Updated MySQL proxy authentication and loopback defaults, test timing, and reserved-prefix checks. * **Release** * Updated the plugin and driver version to 3.1.3. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
JanJakes
added a commit
that referenced
this pull request
Nov 6, 2026
## Summary The WordPress PHPUnit job takes about 10 minutes, and most of that time is PHPUnit itself. This PR speeds it up with two small changes that only affect the tests: - **Turn off PHP's garbage collector for PHPUnit.** While tests run, PHP keeps searching a large amount of memory for objects it can free, and it rarely finds much. In a short-lived test process, this isn't worth the time. - **Use the low bcrypt cost in class fixtures too.** `WP_UnitTestCase::set_up()` lowers the bcrypt cost for each test, but `wpSetUpBeforeClass()` runs before it. Users created there still hash passwords at PHP's default cost, and those hashes took most of the time spent in class fixtures. Test order and the list of expected failures stay unchanged. **Memory use goes up.** A full WordPress PHPUnit run now peaks at about 4.2 GB instead of about 0.5 GB. This fits the 16 GB CI runner, but a local Docker setup needs that much memory available for a full run. The WordPress test bootstrap already removes the PHP memory limit, so no new limit setting is needed. The SQLite plugin suites use the same command and use very little memory either way. The bcrypt issue is in WordPress's own test code, so it could also be fixed there. Until then, `wp-setup.sh` adds the filter, as it already does for other test changes. ## Why PHPUnit takes about 7.5 minutes of the job on slower runners, and the job is by far the slowest one in CI. Profiling showed that the SQLite database itself is under 5% of that time, so these changes target where the time actually goes. ## Measured speedups **On CI:** GitHub-hosted runners vary a lot in speed, so each run is compared with baseline runs on a runner of similar speed. As in #579, the webpack build time from the same job shows the runner's speed. The baseline is 14 recent runs without this change, 12 of which match these two speeds. | Runner | Baseline PHPUnit | This PR | Change | PHPUnit ÷ build time | Whole job | | --- | ---: | ---: | ---: | ---: | ---: | | Slower (build about 14s) | 464s (10 runs) | [286s](https://github.com/WordPress/sqlite-database-integration/actions/runs/42244888948/attempts/3) | **~38% faster** | 32.9 → 21.2 | ~10m50s → 7m35s | | Faster (build about 9s) | 311s (2 runs) | [172s](https://github.com/WordPress/sqlite-database-integration/actions/runs/42244888948/attempts/2) | **~45% faster** | 35.8 → 19.0 | ~7m30s → 5m13s | These are two runs of this PR, one on each runner speed. Test results match the baseline runs: 30,900 tests, with the same errors and failures, and the expected failures check passes. Peak memory went from 515 MB to 4.18 GB. **Locally:** the full suite on native PHP 8.3 (not Docker), in seconds. Each row adds to the one above it. The list of failing tests was identical in all three runs. | Mode | PHPUnit | Change | | --- | ---: | ---: | | Current settings | 197.7s | — | | Garbage collector off | 153.8s | **~22% faster** | | Garbage collector off and low bcrypt cost in fixtures | 126.6s | **~36% faster** | <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Chores** * Updated PHP test execution settings and WordPress test setup. These changes affect the project’s testing configuration; no end-user-facing changes are included. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
E2E jobs sometimes exhaust their 20-minute timeout downloading Playwright system packages. This PR removes that setup step and speeds up WordPress PHPUnit.
.envfile early, so the parallel pull uses the same settings as the test environment.Test order, expected failures, error reporting, and job timeouts stay unchanged.
Measured speedups
GitHub-hosted runners vary in speed. During these measurements, the same PHPUnit job took up to about 70% longer on slower runners. To compare fairly, each PHPUnit time is divided by the webpack build time from the same job. The build runs before the tests, and this PR does not change it.
Comparing only runs on the slower runners, PHPUnit took 9m46s on average without OPcache and 7m49s with OPcache and JIT, about 20% faster. The plugin PHPUnit suites take about 10 seconds, too short to show a difference.
These are estimates from 16 runs on the same day, all on WordPress 7.1.4.
All runs