Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 7 days ago

#58592 closed defect (bug) (fixed)

E2E tests: Investigate inconsistent navigation timeouts

Reported by: joemcgill Owned by:
Priority: normal Milestone: 6.4
Component: Build/Test Tools Version:
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description

Recently, our automated end-to-end (E2E) tests have been failing inconsistently due to a Navigation Timeout error:

TimeoutError: Navigation timeout of 30000 ms exceeded

You can see an example of this type of error in ​a recent run of the workflow against on a PR to update the About Page, which should not have any affect on E2E tests.

The full list of runs where you can see this happening inconsistently, but frequently, is here: ​https://github.com/WordPress/wordpress-develop/actions/workflows/end-to-end-tests.yml

Often rerunning these failing jobs fixes the issue, but we should investigate why this is happening and try to reduce the frequency if possible since it leads to a poor experience and unnecessary overhead to rerun these failing jobs.

Change History (29)

This ticket was mentioned in ​Slack in #core by joedolson. ​View the logs.


3 years ago

#2 @mukesh27
3 years ago

#58591 was marked as a duplicate.

This ticket was mentioned in ​Slack in #core by mukeshpanchal27. ​View the logs.


3 years ago

#4 @SergeyBiryukov
3 years ago

These failures happen on tests using visitAdminPage(), sometimes even after multiple attempts.

It looks like the tests already increase the timeout to 30 seconds from the default 5 seconds. Perhaps GitHub is sometimes low on resources, and in that case increasing the timeout a bit further might help.

This ticket was mentioned in ​Slack in #core by nosolosw. ​View the logs.


3 years ago

#6 @talldanwp
3 years ago

Gutenberg puppeteer e2e tests also started failing at some point. A similar timeout issue.

After bisecting, it seems to be this commit that's causing the issue:
​https://github.com/WordPress/wordpress-develop/commit/8d702842ce2c7dbb457624b8d66fe0536e1a8b48

(this is the associated pull request, which has links to the trac tickets - ​https://github.com/WordPress/wordpress-develop/pull/4570)

I noticed that if I change page.waitForNavigation( { waitUntil: 'networkidle0' } ), to page.waitForNavigation(), in the e2e test, then the test will pass, so possibly the change in the PR interferes with how Puppeteer detects network idle? I'm not entirely sure.

edit: I haven't made any progress on this, though I've narrowed it down to no-store that causes the failing tests. waitUntil: 'networkidle0' means the test should wait until there are no active network requests, and that it fails indicates there is still an active network request. I haven't been able to spot any active ones when testing manually, so it is unusual.

Last edited 3 years ago by talldanwp (previous) (diff)

This ticket was mentioned in ​Slack in #core-editor by talldanwp. ​View the logs.


3 years ago

#8 @talldanwp
3 years ago

A PR was merged in Gutenberg that removes no-store for the test environment - ​https://github.com/WordPress/gutenberg/pull/51826.

Core could probably use a similar approach. I'm not sure if it's a long term fix, but it may help get things moving at this important time.

Having said that, I also notice that core failures started a little earlier than the cache control changes, so it could be that there's more going on.

This ticket was mentioned in ​Slack in #core by ocean90. ​View the logs.


3 years ago

This ticket was mentioned in ​PR #4729 on ​WordPress/wordpress-develop by ​@Clorith.


3 years ago
#10

  • Keywords has-patch has-unit-tests added

This is a WIP (Work In Progress) PR for the E2E tests that have been failing recently, created to allow tests to run and check that enhancements work within the action runners, as well as locally.

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

#11 @Clorith
3 years ago

In 56089:

Build/Test Tools: Switch frame container when testing block editor output.

When the block editor is rendered, the editor content is wrapped inside an iframe tag; The tool used to run End to End (E2E) tests, Puppeteer, puts all such frames into separate containers, but the initial test was checking if the parent page had a given selector, which was leading to timeout failures. By actively switching the container to the iframe wrapper,and setting it as the active context, it helps ensure the expected selectors can be found, and its content can be verrified.

See #58592.
Props joemcgill, SergeyBiryukov, talldanwp, oglekler, Clorith.

#12 @Clorith
3 years ago

In 56090:

Build/Test Tools: Switch frame container when testing block editor output.

The initial commit added the frame lookup within the wrong test, this follow-up restores the previous test runner, and adds the container lookup to the correct test.

Follow-up to [56089].

See #58592.

​@Clorith commented on ​PR #4729:


3 years ago
#13

Committed to trunk in ​7bc7fcf

#14 @SergeyBiryukov
3 years ago

There is a ​PR for the e2e-test-utils package (still waiting for approval at the moment) that aims to fix a race condition within the login procedure and hopefully resolve these timeout issues.

This ticket was mentioned in ​Slack in #core by nekojonez. ​View the logs.


3 years ago

This ticket was mentioned in ​Slack in #core by sergey. ​View the logs.


3 years ago

#18 @SergeyBiryukov
3 years ago

I was hoping that bumping the package version in ​PR 4877 (with ​PR 52144 for the e2e-test-utils package included) would resolve the timeouts, but it did not, so this needs some further investigation.

#19 @audrasjb
3 years ago

  • Milestone 6.3 → 6.4

Moving to milestone 6.4 as WP 6.3 RC3 has been released.

This ticket was mentioned in ​Slack in #core by sergey. ​View the logs.


3 years ago

#21 follow-up: @desrosj
3 years ago

While I was updating the PR associated with #56658 leading up to [56378], I realized I didn't receive a single E2E workflow failure. It's possible that this is now resolved as a result of those changes.

#22 in reply to: ↑ 21 @SergeyBiryukov
3 years ago

Replying to desrosj:

While I was updating the PR associated with #56658 leading up to [56378], I realized I didn't receive a single E2E workflow failure. It's possible that this is now resolved as a result of those changes.

It appears that Performance tests ​still fail with the same timeouts, as well as the ​tests on PR 4877.

This ticket was mentioned in ​Slack in #core by sergey. ​View the logs.


3 years ago

#24 @SergeyBiryukov
3 years ago

  • Resolution → fixed
  • Status new → closed

This appears to be resolved in [56926] / #59517.

This ticket was mentioned in ​PR #13942 on ​WordPress/wordpress-develop by ​@lancewillett.


5 weeks ago
#25

WordPress 6.3’s delayed login autofocus can clear a typed password. Required-field validation then blocks submission, so the legacy E2E helper times out waiting for navigation.

Use the existing enable_login_autofocus filter in a temporary must-use plugin, following ​Gutenberg #6129. The runner respects LOCAL_DIR, preserves existing plugins, and removes its own fixture after completion or interruption.

Trac ticket: #58592, as a 6.3 follow-up to the timeout investigation closed after 6.4 moved to Playwright.

Validation:

  • Production build, explicit JavaScript lint, PHP syntax, and WordPress style checks passed. The branch’s Core-specific PHP rules remain for CI.
  • Quick Draft and Cache Control: 4/4 tests passed with SCRIPT_DEBUG enabled and 4/4 disabled, using Node 14 and Chromium revision 982053.
  • Ten runner lifecycle checks passed. Live HTTP checks confirmed autofocus was restored afterward and required-field validation stayed enabled.

Hosted CI is pending. Assertions, timeouts, and retries remain unchanged.

AI assistance: Codex assisted with investigation, implementation, review, and local validation.

​@lancewillett commented on ​PR #13942:


5 weeks ago
#26

Fixed all five review items and pushed commit 0ad6d50fcb

  • Cleanup tolerates missing fixtures.
  • Repeated Ctrl+C reaches the test child.
  • Fixture copying is simplified.
  • Documentation moved into the plugin docblock.

@lucatume ready for re-review

#27 @lancewillett
4 weeks ago

In 64259:

Build/Test Tools: Disable login autofocus during 6.3 E2E tests.

Prevent delayed login autofocus from clearing passwords during automated input. Temporarily install a must-use plugin using the enable_login_autofocus filter, then remove it after the test runner exits or is interrupted.

Respect LOCAL_DIR, preserve unrelated plugins, pass test arguments through, and forward termination signals to the test process group.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13942

Props lucatume.
See #58592.

​@lancewillett commented on ​PR #4877:


7 days ago
#29

Closing as superseded. Trunk now uses ​@wordpress/e2e-test-utils-playwright and no longer depends on @wordpress/e2e-test-utils, so this version bump no longer applies.

<sub>AI review · <code>gpt-6</code></sub>

Note: See TracTickets for help on using tickets.