-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix: add cy.then timeouts to cy.session #31788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a 20-second timeout to various internal cy.then calls within cy.session to handle cases where navigating to about:blank takes longer than expected, addressing issue [#29496]. It also updates the aut-iframe logic to resolve the promise early when the iframe element is not present and amends the CHANGELOG accordingly.
- Added a COMMAND_TIMEOUT constant to all cy.then calls used within session management.
- Updated the aut-iframe promise to resolve early when necessary.
- Updated the CHANGELOG with details of the bugfix.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/driver/src/cy/commands/sessions/index.ts | Added timeouts to multiple cy.then invocations to increase robustness during session setup and restoration. |
packages/app/src/runner/aut-iframe.ts | Modified visitBlankPage to resolve immediately when the iframe is not available. |
cli/CHANGELOG.md | Updated changelog to describe the bugfix for cy.session timeouts. |
cypress
|
Project |
cypress
|
Branch Review |
mschile/sessions/update_timeout
|
Run status |
|
Run duration | 08m 40s |
Commit |
|
Committer | Matt Schile |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
85
|
View all changes introduced in this branch ↗︎ |
UI Coverage
41.79%
|
|
---|---|
|
36
|
|
28
|
Accessibility
91.43%
|
|
---|---|
|
0 critical
4 serious
0 moderate
0 minor
|
|
94
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whew, that's a lot of thens 😞
Co-authored-by: Bill Glesias <bglesias@gmail.com>
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
We've observed cases where the load event for navigating to
about:blank
has taken more than 4 seconds but does eventually resolve. This can cause thecy.session
command to fail since we don't define our own timeouts for thecy.then
calls withincy.session
. In order to resolve this issue, we are adding a timeout of 20s to the internalcy.then
calls. Long term, we will probably want to investigate removing some of the internalcy.then
calls since they may not be needed.Custom debug logs showing the
about:blank
page taking ~6s to load:Steps to test
about:blank
page to take longer than thedefaultCommandTimeout
and verified it failed before and passes with the new timeouts.How has the user experience changed?
Before:

After:

PR Tasks
cypress-documentation
?type definitions
?