-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: Prevent Promise.map from treating cy.retry failures as successes #33157
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
Open
jennifer-shehane
wants to merge
5
commits into
develop
Choose a base branch
from
fix-promise-map-retry-failures
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+455
−15
Conversation
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
cypress
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Project |
cypress
|
| Branch Review |
fix-promise-map-retry-failures
|
| Run status |
|
| Run duration | 14m 26s |
| Commit |
|
| Committer | Jennifer Shehane |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
9
|
|
|
1
|
|
|
821
|
|
|
4
|
|
|
6982
|
| View all changes introduced in this branch ↗︎ | |
Warning
Partial Report: The results for the Application Quality reports may be incomplete.
UI Coverage
38.41%
|
|
|---|---|
|
|
173
|
|
|
111
|
Accessibility
98.79%
|
|
|---|---|
|
|
1 critical
6 serious
1 moderate
1 minor
|
|
|
59
|
Tests for review
commands/querying/querying.cy.ts • 2 failed tests • 5x-driver-electron
| Test | Artifacts | |
|---|---|---|
| src/cy/commands/querying > #get > cancels existing promises |
Test Replay
|
|
| src/cy/commands/querying > #contains > cancels existing promises |
Test Replay
|
|
The first 5 failed specs are shown, see all 1117 specs in Cypress Cloud.
cypress/e2e/commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox
| Test | Artifacts | |
|---|---|---|
| ... > stops waiting when an xhr request is canceled |
| |
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.
Additional details
The test
does not retry after 1 alias times outwas flaky, failing with:TypeError: Cannot read properties of undefined (reading 'routeId')done() called multiple timescy.retrywas resolving withundefinedinstead of rejecting in two cases:options.errorwas not set._runnableTimeoutto force timeout scenarios. In normal user scenarios,options.erroris always set before callingcy.retry()so this is a test-specific edge case.ended()returned true (promise canceled or runnable changed):Cypress.stop()is called, a test is manually stopped, or the command queue is canceledTo fix:
erroris not set (defensive fix for test scenarios and edge cases)ended()returns true, instead of returningundefined(fixes real-world issue affecting users who stop tests)Note
Ensure
cy.retryalways rejects on timeout or when ended (canceled/runnable changed), preventingPromise.mapfrom treating failures as successes; adds tests and stabilizes a flaky e2e test; updates changelog.packages/driver/src/cy/retries.tsto always throw when timeout is exceeded (even withouterror) and reject whenended()is true (canceled/runnable changed), including checks before/aftercy:command:retry.packages/driver/test/unit/cy/retries.spec.tscovering timeout/ended rejection andPromise.mapbehavior.packages/driver/cypress/e2e/commands/waiting.cy.jsby guardingdone()and usingPromise.onPossiblyUnhandledRejectionwith a single-invocation wrapper in the "does not retry after 1 alias times out" test.cli/CHANGELOG.mdunder15.8.2forcy.wait()crash with multiple aliases when retries are canceled or run between runnables.Written by Cursor Bugbot for commit cd65f42. This will update automatically on new commits. Configure here.
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation?type definitions?