Repository navigation
Repair wp/6.0 branch Actions: Fix theme-activation navigation race in activate-theme.js - #84277
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 |
|
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
2b19410 to
147fbd0
Compare
147fbd0 to
4b951b1
Compare
|
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
4b951b1 to
d798f94
Compare
|
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
d798f94 to
f187306
Compare
f187306 to
436e85a
Compare
Part of #82933.
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 #83002 and #83686. 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.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