Repository navigation
Build/Test Tools: Run the mu-plugin E2E specs in parallel. - #16037
adimoldovan wants to merge 2 commits into
Conversation
Write each must-use plugin under a unique name, through a temporary file that WordPress does not load. Make the fatal error plugin fail only on the test's own request. Move fatal-error-handler and login-localize-script out of the serial project. See #66392.
There was a problem hiding this comment.
🟡 Changes recommended
Missing cleanup of the legacy fatal-error plugin can block suite startup after an interrupted run, while parallel teardown can delete plugins still being loaded by other workers.
2 open issues
What changed in this PR
This PR moves the must-use plugin E2E specs toward parallel execution by isolating fixture files and limiting intentional fatal errors to the requesting test.
Changes:
- Move fatal-error and login-localization specs from the serial project to parallel.
- Add UUID-prefixed plugin filenames and atomic publication through temporary files.
- Make fatal errors request-specific and remove legacy fatal-plugin cleanup from global setup.
| File | Description |
|---|---|
tests/e2e/specs/fatal-error-handler.test.js |
Trigger the fatal error only for a test-specific query parameter. |
tests/e2e/playwright.config.js |
Remove both specs from the serial list. |
tests/e2e/fixtures/site.js |
Publish uniquely named plugin files using temporary files and rename. |
tests/e2e/config/global-setup.js |
Remove legacy fatal-error.php cleanup while retaining maintenance cleanup. |
Review effort: Balanced
A test that deleted its mu-plugin could break a request from another worker: WordPress lists the folder, then includes each file, and the include fails with a warning if the file is gone. Global setup now deletes the test mu-plugins before any test runs. Both plugins now act only on a request with the test's own query parameter. See #66392.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|


Trac ticket: https://core.trac.wordpress.org/ticket/66392
This moves
fatal-error-handler.test.jsandlogin-localize-script.test.jsfrom theserialproject toparallel.muPlugin.write()wrote the final.phpfile in place. A request from another worker could load a half-written file and fail with a parse error. Now the fixture writes a.tmpfile, which WordPress does not load, and renames it. Each file name also gets a UUID prefix, so two copies of one test (for example with--repeat-each) do not overwrite each other's file.write()returns the full path, with the prefix.Testing Instructions
npm run env:start && npm run env:install.npm run test:e2e -- fatal-error-handler login-localize-script. Both tests pass.npm run test:e2e -- --project=parallel --repeat-each=3. All tests pass, and the run includes both specs.src/wp-content/mu-plugins/holds onlyfix-docker-loopback.phpand the test plugins from the last run.Use of AI Tools
AI assistance: Yes