Skip to content

Build/Test Tools: Give each application passwords E2E test its own user. - #15902

Closed
adimoldovan wants to merge 1 commit into
WordPress:trunkfrom
adimoldovan:e2e/application-passwords-parallel
Closed

adimoldovan wants to merge 1 commit into
WordPress:trunkfrom
adimoldovan:e2e/application-passwords-parallel

Conversation

@adimoldovan

Copy link
Copy Markdown

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

applications-passwords.test.js failed in the parallel project when two copies of it ran at the same time. Each test used the admin user and revoked all of its application passwords, so each copy saw and deleted the passwords of the other.

Each test now starts logged out, creates its own subscriber with userFactory, and signs in as that user. The REST checks read that user's passwords by ID, not through /users/me. userFactory deletes the user, and so its passwords, when the test ends.

Testing Instructions

  1. Run npm run test:e2e -- --project=parallel tests/e2e/specs/profile/applications-passwords.test.js --repeat-each=10 --retries=0. All 30 tests pass.
  2. Run npm run test:e2e -- tests/e2e/specs/profile/applications-passwords.test.js. All 3 tests pass.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Code change, test runs and this description.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Each test used the admin user and revoked all of its application passwords. When two copies of the spec ran at the same time in the parallel project, each copy deleted the passwords of the other.

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 recorded for the application-password test isolation changes.

No open issues 🎉

What changed in this PR

This PR isolates the application-password end-to-end tests so parallel runs no longer interfere with each other’s passwords.

Changes:

  • Start each test logged out, create a dedicated subscriber with userFactory, and sign in.
  • Query application passwords by the test user’s ID instead of /users/me.
  • Rely on factory user cleanup instead of explicitly revoking passwords before and after each test.
File Description
tests/​e2e/​specs/​profile/​applications-passwords.test.js Use per-test users and user-specific REST queries to isolate parallel runs.

Review effort: Balanced

@adimoldovan
adimoldovan marked this pull request as ready for review November 11, 2026 14:12
@adimoldovan
adimoldovan requested a review from a team November 11, 2026 14:12
@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 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.

@lancewillett lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified the isolation benefit using the existing spec with two workers, --repeat-each=10 --retries=0, and a clean database before each run: baseline had 7 failures and 23 passes; this revision passed all 30 cases with the same assertions.

Baseline failures included another concurrent copy’s password remaining after revocation, and a newly created password disappearing before its REST assertion. Per-test users isolate those records; final cleanup left no test users or application-password metadata. All four E2E CI jobs also passed.

No blocking findings remain.

AI review · gpt-6

@lancewillett lancewillett moved this from Backlog to Ready in WordPress Project Build Tooling Nov 11, 2026
wporg-sync pushed a commit that referenced this pull request Nov 11, 2026
…E2E tests.

Track and clean up each test's attachments, and run the Add New Media spec in parallel. Give each application-password test its own user.

Developed in: #15896, #15902

Props adrianmoldovanwp.
See #66392.


git-svn-id: https://develop.svn.wordpress.org/trunk@65402 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 11, 2026
…E2E tests.

Track and clean up each test's attachments, and run the Add New Media spec in parallel. Give each application-password test its own user.

Developed in: WordPress/wordpress-develop#15896, WordPress/wordpress-develop#15902

Props adrianmoldovanwp.
See #66392.

Built from https://develop.svn.wordpress.org/trunk@65402


git-svn-id: http://core.svn.wordpress.org/trunk@64541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@lancewillett

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants