Skip to content

Build/Test Tools: Stop the General Settings E2E specs from running together. - #15846

Closed
adimoldovan wants to merge 1 commit into
WordPress:trunkfrom
adimoldovan:e2e/general-settings-lock
Closed

adimoldovan wants to merge 1 commit into
WordPress:trunkfrom
adimoldovan:e2e/general-settings-lock

Conversation

@adimoldovan

Copy link
Copy Markdown

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

general-settings.test.js and general-settings-invalid-timezone.test.js both save the General Settings form. A save writes every field on the page, not only the field that the test changed. When the two specs run at the same time in the parallel project, each save can undo the other spec's change. Both specs were flaky in the same trunk runs, for example 42223319054 and 42131015449.

Both specs now hold the same Playwright test lock, so they never run at the same time. They stay in parallel. #15750 moves the timezone spec to serial instead, which makes the slowest CI job longer.

import { GENERAL_SETTINGS } from '../utils/locks';

test.describe( 'Settings -> General', { lock: GENERAL_SETTINGS }, () => {} );

The README gets a "Parallel safety" section: scope the test data, else lock every spec that writes the shared data, else move the spec to serial. This changes the old rule, which sent every spec that changes content or settings that other tests use to serial.

Testing Instructions

  1. Run npm run test:e2e -- --project=parallel tests/e2e/specs/general-settings --repeat-each=10 --retries=0.
  2. Confirm that all 40 tests pass. On trunk, about half of them fail, because the repeated copies of the specs run at the same time.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: The lock, the README section, 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.

…gether.

Both specs save the General Settings form, and a save writes every field on the page. When the specs run at the same time in the `parallel` project, each save can undo the other spec's change. Both specs now hold the same Playwright test lock, so they stay in `parallel` but never overlap.

See #66392.
@github-actions

github-actions Bot commented Nov 9, 2026

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.

Approving at 8dd6a31. This replaces #15750: it fixes both specs that save the General Settings form, not just the timezone one, and keeps them in parallel.

  • The pinned @playwright/test 1.64.1 supports lock on test.describe().
  • Only these two specs write General Settings options. privacy.test.js changes page_for_privacy_policy, which isn't on that form, so the lock covers every writer, as the new README rule requires.
  • The parallel E2E jobs passed with no retries (45 tests each), and so did the serial jobs.
  • The changed spec and utils/locks.js lines pass Prettier. The other warnings in the two specs are on lines trunk already has.

The README's "Parallel safety" order (scope the data, else lock every writer, else go serial) matches the plan on #66392.

AI review · claude-opus-5-5

wporg-sync pushed a commit that referenced this pull request Nov 9, 2026
…gether.

Both General Settings specs save the whole form, which writes every field on the page. When they ran at the same time in the `parallel` project, one spec's save could undo the other's change. Give both specs the same Playwright test lock, so they never overlap but stay in `parallel`.

Add a "Parallel safety" section to the E2E README: scope the test data, else lock every spec that writes the shared data, else move the spec to `serial`.

Developed in: #15846

Props adrianmoldovanwp.
See #66392.


git-svn-id: https://develop.svn.wordpress.org/trunk@65347 602fd350-edb4-49c9-b593-d223f7449a82
@lancewillett

Copy link
Copy Markdown
Member

wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 9, 2026
…gether.

Both General Settings specs save the whole form, which writes every field on the page. When they ran at the same time in the `parallel` project, one spec's save could undo the other's change. Give both specs the same Playwright test lock, so they never overlap but stay in `parallel`.

Add a "Parallel safety" section to the E2E README: scope the test data, else lock every spec that writes the shared data, else move the spec to `serial`.

Developed in: WordPress/wordpress-develop#15846

Props adrianmoldovanwp.
See #66392.

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


git-svn-id: http://core.svn.wordpress.org/trunk@64487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.

2 participants