Skip to content

Speed up PHPUnit and avoid E2E setup timeouts - #579

Merged
JanJakes merged 2 commits into
trunkfrom
fix-e2e-browser-setup
Oct 28, 2026
Merged

JanJakes merged 2 commits into
trunkfrom
fix-e2e-browser-setup

Conversation

@JanJakes

@JanJakes JanJakes commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

E2E jobs sometimes exhaust their 20-minute timeout downloading Playwright system packages. This PR removes that setup step and speeds up WordPress PHPUnit.

  • Avoid browser installation timeouts by using the official Docker image matching WordPress’s installed Playwright version.
  • Pull Docker images faster and more reliably. The Playwright and WordPress images download in parallel. A stuck Playwright image pull stops after 3 minutes, and a failed one is retried, up to 3 attempts. Setup now creates WordPress’s .env file early, so the parallel pull uses the same settings as the test environment.
  • Show browser server logs when an E2E job fails or times out.
  • Speed up WordPress PHPUnit by enabling CLI OPcache and tracing JIT.
  • Remove unused Docker Buildx setup from the four WordPress test workflows.

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.

Mode Runs PHPUnit ÷ build time Change
Without OPcache (trunk and other PRs) 10 34.1 —
OPcache 3 29.0 ~15% faster
OPcache and tracing JIT 3 25.5 ~25% faster

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
Run Mode PHPUnit Build Ratio
40716913795 OPcache and JIT 7m59.1s 18.0s 26.6
40712439242 OPcache and JIT 7m38.4s 17.8s 25.8
40704150768 OPcache and JIT 5m16.3s 13.1s 24.2
40701867316 OPcache 8m05.5s 17.0s 28.6
40694469161 OPcache 8m43.9s 17.7s 29.6
40690272800 OPcache 8m41.0s 18.1s 28.8
40716362956 Without OPcache 7m03.8s 11.9s 35.6
40712857322 Without OPcache 10m02.3s 18.1s 33.3
40709850513 Without OPcache 6m17.2s 12.6s 29.8
40708807510 Without OPcache 9m33.9s 16.8s 34.3
40703990906 Without OPcache 6m19.5s 10.1s 37.6
40703886731 Without OPcache 6m27.3s 10.4s 37.4
40701787710 Without OPcache 5m46.9s 12.7s 27.2
40697656411 Without OPcache 8m07.6s 13.7s 35.7
40689426132 Without OPcache 7m23.4s 12.2s 36.5
40669664710 Without OPcache 9m42.9s 17.3s 33.6

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 142dc5bc-66df-497d-8107-40286fdd37c4
Commits

Reviewing files that changed from the base of the PR and between ec510fb and 84eb24a.

Files selected for processing: 8
  • .github/actions/playwright/action.yml
  • .github/actions/playwright/docker-compose.yml
  • .github/workflows/end-to-end-tests.yml
  • .github/workflows/sqlite-plugin-phpunit-tests.yml
  • .github/workflows/wp-tests-end-to-end.yml
  • .github/workflows/wp-tests-phpunit.yml
  • composer.json
  • wp-setup.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JanJakes JanJakes changed the title Avoid E2E timeouts during Playwright setup Speed up PHPUnit and avoid E2E setup timeouts Oct 28, 2026
@JanJakes
JanJakes force-pushed the fix-e2e-browser-setup branch 3 times, most recently from e7329d8 to a6f85a1 Compare October 28, 2026 15:05
@JanJakes
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
JanJakes force-pushed the fix-e2e-browser-setup branch from a6f85a1 to 84eb24a Compare October 28, 2026 15:31
@JanJakes
JanJakes merged commit 84bff0c into trunk Oct 28, 2026
18 checks passed
@JanJakes
JanJakes deleted the fix-e2e-browser-setup branch October 28, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant