Skip to content
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

fix: yield waited responses in the order that they occured #27806

Merged
merged 19 commits into from
Oct 3, 2023

Conversation

astone123
Copy link
Contributor

Additional details

This PR sorts the yielded responses from a cy.wait command by browserRequestId so that the responses are returned in the correct order even when the same alias name is used.

Steps to test

Follow the reproduction steps in the original issue

How has the user experience changed?

PR Tasks

@astone123 astone123 self-assigned this Sep 13, 2023
@astone123 astone123 changed the title fix: yield waited requests in the order that they occured fix: yield waited responses in the order that they occured Sep 13, 2023
@cypress
Copy link

cypress bot commented Sep 13, 2023

9 flaky tests on run #51416 ↗︎

0 9872 1078 0 Flakiness 9

Details:

collate new tests under existing describe
Project: cypress Commit: 06ab7c0387
Status: Passed Duration: 17:31 💡
Started: Oct 3, 2023 7:36 PM Ended: Oct 3, 2023 7:54 PM
Flakiness  e2e/origin/commands/assertions.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test Artifacts
cy.origin assertions > #consoleProps > .should() and .and() Output
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-firefox

View Output Video

Test Artifacts
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output
Flakiness  commands/net_stubbing.cy.ts • 2 flaky tests • 5x-driver-webkit

View Output Video

Test Artifacts
... > with `times` > only uses each handler N times Output
... > stops waiting when an xhr request is canceled Output
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-webkit

View Output Video

Test Artifacts
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output

Review all test suite changes for PR #27806 ↗︎

@astone123 astone123 marked this pull request as ready for review September 20, 2023 22:31
Copy link
Contributor

@chrisbreiding chrisbreiding left a comment

Choose a reason for hiding this comment

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

We should add a test for this.

@dkasper-was-taken
Copy link
Contributor

We should add a test for this.

@chrisbreiding Test case added.

@chrisbreiding chrisbreiding self-requested a review October 2, 2023 17:25
Copy link
Contributor

@chrisbreiding chrisbreiding left a comment

Choose a reason for hiding this comment

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

Over all looks good, though the new test seems to be failing or flaky in webkit 😔

packages/driver/src/cy/commands/waiting.ts Show resolved Hide resolved
@dkasper-was-taken
Copy link
Contributor

dkasper-was-taken commented Oct 3, 2023

Over all looks good, though the new test seems to be failing or flaky in webkit 😔

@chrisbreiding Looking at webkit, it fails locally as well. Apparently if we wait 6 or more aliases the call fails to resolve regardless of timeout set. This occurs even if I revert the newly added sort logic.

Are there any known limitations with webkit around the # of xhr calls?

@chrisbreiding
Copy link
Contributor

Are there any known limitations with webkit around the # of xhr calls?

Not that I know of, but webkit has a lot of known and unknown issues, so it's not too surprising there's a weird issue with it.

@chrisbreiding
Copy link
Contributor

I guess we should just have the test use less aliases so that it can work in webkit too.

@dkasper-was-taken dkasper-was-taken dismissed their stale review October 3, 2023 17:50

involved in change

@dkasper-was-taken dkasper-was-taken merged commit c573160 into develop Oct 3, 2023
79 of 82 checks passed
@dkasper-was-taken dkasper-was-taken deleted the astone123/wait-order branch October 3, 2023 20:16
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2023

Released in 13.3.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.3.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cy.wait on an array of the same alias does not resolve in expected order
5 participants