Repository navigation
Repair wp/6.5 branch Actions: Fix theme-activation navigation race in activate-theme.js - #83002
Open
desrosj wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
desrosj
added this pull request to stack #83006
September 16, 2026 00:34
|
Size Change: 0 B Total Size: 1.72 MB ℹ️ View Unchanged
|
desrosj
removed this pull request from stack #83006
September 21, 2026 15:45
desrosj
added this pull request to stack #83283
September 21, 2026 15:45
desrosj
removed this pull request from stack #83283
September 21, 2026 18:44
desrosj
changed the base branch from
fix-actions-6.5/remove-svn-version-debug-check
to
wp/6.5
September 21, 2026 18:45
desrosj
force-pushed
the
fix-actions-6.5/fix-activate-theme-navigation-race
branch
from
September 21, 2026 18:52
4acdc86 to
819d8b9
Compare
desrosj
changed the base branch from
wp/6.5
to
fix-actions-6.5/remove-svn-version-debug-check
September 21, 2026 18:53
desrosj
added this pull request to stack #83288
September 21, 2026 18:53
desrosj
removed this pull request from stack #83288
September 21, 2026 23:45
desrosj
changed the base branch from
fix-actions-6.5/remove-svn-version-debug-check
to
wp/6.5
September 21, 2026 23:46
desrosj
force-pushed
the
fix-actions-6.5/fix-activate-theme-navigation-race
branch
from
September 21, 2026 23:48
819d8b9 to
aa4b679
Compare
desrosj
changed the base branch from
wp/6.5
to
fix-actions-6.5/remove-svn-version-debug-check
September 21, 2026 23:52
desrosj
added this pull request to stack #83302
September 21, 2026 23:52
desrosj
removed this pull request from stack #83302
September 22, 2026 17:11
desrosj
changed the base branch from
fix-actions-6.5/remove-svn-version-debug-check
to
wp/6.5
September 22, 2026 17:12
desrosj
force-pushed
the
fix-actions-6.5/fix-activate-theme-navigation-race
branch
from
September 22, 2026 17:15
aa4b679 to
ee2476c
Compare
desrosj
changed the base branch from
wp/6.5
to
fix-actions-6.5/upgrade-playwright
September 22, 2026 17:16
desrosj
added this pull request to stack #83397
September 22, 2026 17:16
desrosj
removed this pull request from stack #83397
September 22, 2026 23:10
desrosj
changed the base branch from
fix-actions-6.5/upgrade-playwright
to
wp/6.5
September 22, 2026 23:11
desrosj
removed this pull request from stack #83740
October 7, 2026 18:12
desrosj
changed the base branch from
fix-actions-6.5/upgrade-playwright
to
wp/6.5
October 7, 2026 18:13
desrosj
force-pushed
the
fix-actions-6.5/fix-activate-theme-navigation-race
branch
from
October 7, 2026 18:15
288e927 to
d653afc
Compare
desrosj
changed the base branch from
wp/6.5
to
fix-actions-6.5/upgrade-playwright
October 7, 2026 18:17
desrosj
added this pull request to stack #84186
October 7, 2026 18:17
This was referenced Oct 8, 2026
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Oct 8, 2026
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 #84186
October 8, 2026 18:31
desrosj
changed the base branch from
fix-actions-6.5/upgrade-playwright
to
wp/6.5
October 8, 2026 18:31
desrosj
changed the base branch from
wp/6.5
to
fix-actions-6.5/upgrade-playwright
October 8, 2026 18:40
desrosj
added this pull request to stack #84338
October 8, 2026 18:40
desrosj
removed this pull request from stack #84338
October 8, 2026 21:33
desrosj
changed the base branch from
fix-actions-6.5/upgrade-playwright
to
wp/6.5
October 8, 2026 21:34
desrosj
force-pushed
the
fix-actions-6.5/fix-activate-theme-navigation-race
branch
from
October 8, 2026 21:35
d653afc to
43bae84
Compare
desrosj
changed the base branch from
wp/6.5
to
fix-actions-6.5/upgrade-playwright
October 8, 2026 21:36
desrosj
added this pull request to stack #84352
October 8, 2026 21:37
This was referenced Oct 9, 2026
This branch has not been deployed
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.
Part of #82928.
What?
Fixes a race condition in
packages/e2e-test-utils/src/activate-theme.js'sactivateTheme()helper, responsible for all 19 tests inpackages/e2e-tests/specs/editor/various/change-detection.test.jsfailing in CI with:activateTheme()clicks the "Activate" link onwp-admin/themes.php, then immediately callspage.waitForSelector()(bare 30s Puppeteer default) to confirm the click took effect. The click itself is never wrapped in apage.waitForNavigation(). This PR wraps it in one, mirroring the existing, already-correct pattern already used bypackages/e2e-test-utils/src/login-user.js, and gives the trailingwaitForSelector()its own explicit 45s timeout.Why?
WordPress core's "Activate" link (
wp-admin/js/theme.js) is a plain, unhandled<a href>— clicking it triggers a real, full-page, server-driven navigation (switch_theme(), then a redirect back tothemes.php), not a client-side/JS-intercepted action. Without an explicitpage.waitForNavigation()around the click, the single, bare 30swaitForSelector()that follows has to cover the entire click → serverswitch_theme()→ redirect → full admin-page reload chain by itself. That's a genuine race: a sibling e2e test file's identicalactivateTheme()call passed in the same CI run in which this one failed, and the sharedbeforeAllhook inconfig/setup-test-framework.jscallsactivateTheme( 'twentytwentyone' )once per test file — so any file unlucky enough to hit a slow tail on that one click loses the race and fails outright.login-user.jsalready solves the identical problem correctly for its own submit-button click:This PR applies the same pattern to
activateTheme()'s click, so the existingisCurrentURL()/fallback-revisit logic and the finalwaitForSelector()only ever run once navigation has genuinely finished. The trailingwaitForSelector()also gets an explicit 45s timeout (up from Puppeteer's bare 30s default) — some headroom for the page's own post-navigation render tail (WordPress admin loading/parsing/rendering its JS bundles after the reload), without silently masking a real future regression by setting it unreasonably high.The existing "theme has no activate button" branch (meaning the theme is already active) is untouched: it returns immediately after
switchUserToTest(), before the click/navigation code is ever reached, so it's unaffected by this change and never triggers a navigation wait.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.