Skip to content

Repair wp/7.1 branch Actions: Fix flaky interactivity router navigate e2e test - #83646

Open
desrosj wants to merge 1 commit into
fix-actions-7.1/update-php-test-matrixfrom
fix-actions-7.1/fix-flaky-router-navigate-test
Open

desrosj wants to merge 1 commit into
fix-actions-7.1/update-php-test-matrixfrom
fix-actions-7.1/fix-flaky-router-navigate-test

Conversation

@desrosj

@desrosj desrosj commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Part of #82781.

What?

Makes the "should update the HTML only for the latest navigation" test in test/e2e/specs/interactivity/router-navigate.spec.ts wait until the browser has requested both linked pages before letting either request through.

Why?

The test holds each page request in a page.route() handler, and the functions that let a request through (resolveLink1 and resolveLink2) are only assigned once those handlers run. The test only waited for the page's own navigation counter, which can reach 2 before Playwright has run the handlers, so calling resolveLink2() could fail with TypeError: resolveLink2 is not a function. It hasn't been seen failing on this stack, but this branch has the same test, so the fix is included for consistency.

Upstream

A straight cherry-pick of e693c18 (#80178) from trunk.

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

@desrosj desrosj added the [Type] Build Tooling Issues or PRs related to build tooling label Sep 28, 2026
@desrosj desrosj self-assigned this Sep 28, 2026
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c74713e9-1e1e-4c04-be7f-65c8fa3ee2fd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@desrosj
desrosj added this pull request to stack #83629 September 28, 2026 18:13
@desrosj
desrosj marked this pull request as ready for review September 28, 2026 18:18
@github-actions

github-actions Bot commented Sep 28, 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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>

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.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: 0 B

Total Size: 7.75 MB

d5b89d0 Run

🏁 Flaky tests

Show the failures

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Should save the changes in /test/e2e/specs/editor/plugins/wp-editor-meta-box.spec.js, passed after 2 failed attempts.
TimeoutError: page.waitForFunction: Timeout 10000ms exceeded.
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/plugins/wp-editor-meta-box.spec.js:37:14
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=button[name="Visual"i]')

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/plugins/wp-editor-meta-box.spec.js:36:55
can be replaced by dragging-and-dropping images from the inserter in /test/e2e/specs/editor/blocks/image.spec.js, passed after 2 failed attempts.
TimeoutError: locator.dragTo: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('region', { name: 'Block Library' }).getByRole('listbox', { name: 'Media List' }).getByRole('option').first()

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:359:5
TimeoutError: locator.dragTo: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('region', { name: 'Block Library' }).getByRole('listbox', { name: 'Media List' }).getByRole('option').first()

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:359:5
should update the URL from the last navigation if only varies in the URL fragment in /test/e2e/specs/interactivity/router-navigate.spec.ts, passed after 1 failed attempt.
Error: expect(locator).toHaveText(expected) failed

Locator:  getByTestId('title')
Expected: "Link 1"
Received: "Main"
Timeout:  5000ms

Call log:
  - Expect "toHaveText" with timeout 5000ms
  - waiting for getByTestId('title')
    14 × locator resolved to <h2 data-testid="title">Main</h2>
       - unexpected value "Main"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigate.spec.ts:163:25

d5b89d0 Run

@desrosj
desrosj force-pushed the fix-actions-7.1/fix-flaky-router-navigate-test branch from 74cebda to b18f4ca Compare October 7, 2026 13:42
@desrosj
desrosj force-pushed the fix-actions-7.1/fix-flaky-router-navigate-test branch from b18f4ca to c31c0ef Compare October 7, 2026 15:55
@desrosj
desrosj removed this pull request from stack #83629 October 8, 2026 21:07
@desrosj
desrosj changed the base branch from fix-actions-7.1/update-php-test-matrix to wp/7.1 October 8, 2026 21:08
@desrosj
desrosj force-pushed the fix-actions-7.1/fix-flaky-router-navigate-test branch from c31c0ef to cb67e1c Compare October 8, 2026 21:08
@desrosj
desrosj changed the base branch from wp/7.1 to fix-actions-7.1/update-php-test-matrix October 8, 2026 21:09
@desrosj
desrosj added this pull request to stack #84346 October 8, 2026 21:10
@desrosj
desrosj removed this pull request from stack #84346 October 9, 2026 23:21
@desrosj
desrosj changed the base branch from fix-actions-7.1/update-php-test-matrix to wp/7.1 October 9, 2026 23:21
@desrosj
desrosj force-pushed the fix-actions-7.1/fix-flaky-router-navigate-test branch from cb67e1c to 4d8f9ec Compare October 9, 2026 23:22
@desrosj
desrosj changed the base branch from wp/7.1 to fix-actions-7.1/update-php-test-matrix October 9, 2026 23:23
@desrosj
desrosj added this pull request to stack #84466 October 9, 2026 23:23
@desrosj
desrosj force-pushed the fix-actions-7.1/fix-flaky-router-navigate-test branch from 4d8f9ec to 4fefba4 Compare October 19, 2026 17:02
@desrosj
desrosj removed this pull request from stack #84466 October 21, 2026 18:35
@desrosj
desrosj added this pull request to stack #85326 October 21, 2026 18:36

@ntsekouras ntsekouras left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks! Same change as trunk's #80178.

@desrosj
desrosj force-pushed the fix-actions-7.1/fix-flaky-router-navigate-test branch from 4fefba4 to d5b89d0 Compare October 24, 2026 18:02
@desrosj
desrosj removed this pull request from stack #85326 October 24, 2026 18:04
@desrosj
desrosj added this pull request to stack #85508 October 24, 2026 18:04

This branch has not been deployed

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

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants