Skip to content

Build/Test Tools: Run the mu-plugin E2E specs in parallel. - #16037

Open
adimoldovan wants to merge 2 commits into
WordPress:trunkfrom
adimoldovan:e2e/mu-plugin-specs-parallel
Open

adimoldovan wants to merge 2 commits into
WordPress:trunkfrom
adimoldovan:e2e/mu-plugin-specs-parallel

Conversation

@adimoldovan

@adimoldovan adimoldovan commented Nov 16, 2026 •

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/66392

This moves fatal-error-handler.test.js and login-localize-script.test.js from the serial project to parallel.

  • muPlugin.write() wrote the final .php file in place. A request from another worker could load a half-written file and fail with a parse error. Now the fixture writes a .tmp file, 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.
  • The fatal error plugin broke every request on the site. Now it fails only on a request with the test's own query parameter. The login plugin uses the same gate.
  • A test that deleted its plugin at the end 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. Now global setup deletes the test plugins before any test runs, and the files stay until then.

Testing Instructions

  1. Start the local environment: npm run env:start && npm run env:install.
  2. Run npm run test:e2e -- fatal-error-handler login-localize-script. Both tests pass.
  3. Run npm run test:e2e -- --project=parallel --repeat-each=3. All tests pass, and the run includes both specs.
  4. Run step 3 again. src/wp-content/mu-plugins/ holds only fix-docker-loopback.php and the test plugins from the last run.

Use of AI Tools

AI assistance: Yes

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread tests/e2e/config/global-setup.js Resolved
Comment thread tests/e2e/fixtures/site.js Resolved
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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the changes enabling parallel execution of the two must-use-plugin E2E specs.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@adimoldovan
adimoldovan marked this pull request as ready for review November 16, 2026 17:09
@adimoldovan
adimoldovan requested a review from a team November 16, 2026 17:09
@github-actions

Copy link
Copy Markdown

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:

Props adrianmoldovanwp.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

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.

2 participants