Repository navigation
Repair wp/6.3 branch Actions: Fix theme-activation navigation race in activate-theme.js - #536
Closed
desrosj wants to merge 1 commit into
Conversation
desrosj
changed the base branch from
wp/6.3
to
fix-actions-6.3/fix-playwright-noble-install
September 28, 2026 14:32
desrosj
added this pull request to stack #537
September 28, 2026 14:32
desrosj
removed this pull request from stack #537
September 28, 2026 15:24
desrosj
added this pull request to stack #552
September 28, 2026 15:25
desrosj
removed this pull request from stack #552
September 28, 2026 18:41
desrosj
changed the base branch from
fix-actions-6.3/fix-playwright-noble-install
to
wp/6.3
September 28, 2026 18:43
desrosj
force-pushed
the
fix-actions-6.3/fix-activate-theme-navigation-race
branch
from
September 28, 2026 18:45
d1f80c3 to
a6351fd
Compare
desrosj
changed the base branch from
wp/6.3
to
fix-actions-6.3/fix-playwright-noble-install
September 28, 2026 18:46
desrosj
added this pull request to stack #563
September 28, 2026 18:46
WordPress core's "Activate" link on wp-admin/themes.php is a plain
<a href>: clicking it causes a real, full-page, server-driven navigation
(switch_theme(), then a redirect back to themes.php). activateTheme()
clicked that link without waiting for the navigation, so the single,
bare 30s page.waitForSelector() immediately afterward had to cover the
entire click -> switch_theme() -> redirect -> admin page reload chain
by itself.
Wrap the click in Promise.all() with page.waitForNavigation( {
waitUntil: 'networkidle0' } ), so the final page.waitForSelector() only
runs once the navigation has finished, and give that wait an explicit
45s timeout instead of Puppeteer's 30s default, as headroom for the
page's own post-navigation render.
The "no activate button found" branch (the theme is already active)
returns before the click and is unchanged.
This is the same change as the equivalent fixes on wp/6.5
(WordPress#83002) and wp/6.4 (#328), where
this race failed the Puppeteer suite in CI. It has not been seen to fail
on this branch; it is included so the helper behaves the same across
branches and a future failure here does not need to be rediscovered.
desrosj
removed this pull request from stack #563
September 28, 2026 19:03
desrosj
changed the base branch from
fix-actions-6.3/fix-playwright-noble-install
to
wp/6.3
September 28, 2026 19:03
desrosj
force-pushed
the
fix-actions-6.3/fix-activate-theme-navigation-race
branch
from
September 28, 2026 19:03
a6351fd to
88fdb60
Compare
desrosj
changed the base branch from
wp/6.3
to
fix-actions-6.3/fix-playwright-noble-install
September 28, 2026 19:04
desrosj
added this pull request to stack #566
September 28, 2026 19:04
desrosj
marked this pull request as ready for review
September 28, 2026 19:18
Owner
Author
|
Moved to WordPress#83713. The branch is left in place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes a theme-activation navigation race in
packages/e2e-test-utils/src/activate-theme.js'sactivateTheme()helper, used by the Puppeteer end-to-end suite (including the sharedconfig/setup-test-framework.jssetup, which activates a theme before each spec file).activateTheme()clicks the "Activate" link onwp-admin/themes.php, then immediately callspage.waitForSelector()with Puppeteer's default 30s timeout to confirm the theme became active. This PR wraps the click inPromise.all()withpage.waitForNavigation( { waitUntil: 'networkidle0' } ), and gives the finalwaitForSelector()an explicit 45s timeout.Why?
The "Activate" link is a plain link: clicking it triggers a real, full-page navigation (
switch_theme()on the server, then a redirect back tothemes.php). Without waiting for that navigation, the singlewaitForSelector()that follows has to cover the whole click → theme switch → redirect → page reload chain by itself, which can time out with:On
wp/6.5andwp/6.4this race failed the Puppeteer suite in CI repeatedly (onwp/6.4, 20 of 114 failed end-to-end runs without the fix hit it; 0 of 49 with it), and it is fixed there by WordPress#83002 and #328. This branch has the same race in an older form of the helper, but it has not been seen to fail here: none of the 20 most recent failed end-to-end runs on this branch's stack hit it. It is included proactively, so the helper behaves the same across branches and a future failure here does not have to be investigated from scratch. (An earlier review on 2026-09-13 decided not to include it on the branches where it had not failed; that decision has been reversed for consistency.)The code is the same as on
wp/6.5andwp/6.4, includingwaitUntil: 'networkidle0'. This branch'slogin-user.jswaits for its own submit navigation with a plainpage.waitForNavigation(); the same form as the other branches' fix is used here so the helper is identical everywhere. The "theme is already active" early return is unchanged.Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.
🤖 Generated with Claude Code