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: (driver) add null check for browserRequestId on responses for cy.wait #28713

Merged
merged 3 commits into from
Jan 12, 2024

Conversation

astone123
Copy link
Contributor

Additional details

In #27806, we added sorting to the list of responses that we get in the wait command. The sorting algorithm uses the browserRequestId attribute to sort responses with the same aliases and return them in the order in which they were received by the browser.

Sometimes this attribute isn't defined on the responses which causes us to throw an error when we call .split on undefined. This PR updates the sorting logic to just return the responses with the original sort order if either of the requests that we're comparing don't have a browserRequestId.

Steps to test

I wasn't able to actually reproduce this - but adding the null check should at least make it so that we don't throw if the response doesn't have the expected properties.

How has the user experience changed?

PR Tasks

Copy link

cypress bot commented Jan 12, 2024

5 flaky tests on run #53495 ↗︎

0 811 10 0 Flakiness 5

Details:

remove unnecessary operator
Project: cypress Commit: 80e0f2c29f
Status: Passed Duration: 12:20 💡
Started: Jan 12, 2024 6:32 PM Ended: Jan 12, 2024 6:44 PM
Flakiness  debug.cy.ts • 1 flaky test • app-e2e

View Output

Test Artifacts
App - Debug Page > shows information about a failed spec Test Replay Screenshots
Flakiness  runs.cy.ts • 1 flaky test • app-e2e

View Output

Test Artifacts
... > opens the run page if a run is clicked Test Replay Screenshots
Flakiness  runner/sessions.ui.cy.ts • 1 flaky test • app-e2e

View Output

Test Artifacts
runner/cypress sessions.ui.spec > recreates session Test Replay Screenshots
Flakiness  specs_list_e2e.cy.ts • 1 flaky test • app-e2e

View Output

Test Artifacts
... > saves the filter when navigating to a spec and back Test Replay Screenshots
Flakiness  specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e

View Output

Test Artifacts
App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs Test Replay Screenshots

Review all test suite changes for PR #28713 ↗︎

Copy link
Contributor

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

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

is there a way we can add a test for this?

@astone123
Copy link
Contributor Author

@AtofStryker I'm not really sure how to test this - I guess I could break the sort function out and unit test it? 😬

@AtofStryker
Copy link
Contributor

@AtofStryker I'm not really sure how to test this - I guess I could break the sort function out and unit test it? 😬

I saw you were able to reproduce it. Is it something that happens intermittently or can you reproduce it every single time?

@astone123
Copy link
Contributor Author

I am not able to reproduce it. Looks like for this person it only happens for a specific test? #28233 (comment). Others say that it happens intermittently

@AtofStryker
Copy link
Contributor

@astone123 OK I read that wrong 😂 . I think its a good guess that this would fix there issue, but should be build a binary to be sure to have them test?

@astone123 astone123 merged commit 8a02c2d into develop Jan 12, 2024
79 of 81 checks passed
@astone123 astone123 deleted the waiting-request-id-null-check branch January 12, 2024 20:48
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 17, 2024

Released in 13.6.3.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 17, 2024
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 return TypeError Cannot read property 'split' of undefined line 136007:55
3 participants