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

test: rewrite flaky 1244 test to no longer be flaky #28694

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Jan 11, 2024

  • Closes

Additional details

This spec exposed odd caching behavior in Electron open mode, exacerbated by the upgrade to Electron 27. An issue was opened to address this bug, but this PR addresses the flaky test. The commented version of this test will reliably hang when Cypress attempts to perform a cross-origin postMessage handshake, because the browser caches a version of dom.html that does not have the cross-origin support script due to it being loaded in a new window via target=_blank.

Steps to test

Run the issues/1244.cy.js driver spec in open mode with Electron, and verify that the final test does not hang.

How has the user experience changed?

PR Tasks

@cacieprins cacieprins marked this pull request as ready for review January 11, 2024 14:53
@mschile
Copy link
Contributor

mschile commented Jan 11, 2024

The PR title should probably be test: instead of chore: per the change-categories.

@@ -80,5 +88,16 @@ describe('issue 1244', () => {
cy.get('#dom').should('contain', 'DOM')
cy.url().should('include', 'dom.html')
})
*/

it('does not strip link_parent', () => {
Copy link
Member

Choose a reason for hiding this comment

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

do we need the commented out test above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept the commented out test, as it's the reproduction case for #28681

Copy link
Member

@emilyrohrbough emilyrohrbough Jan 11, 2024

Choose a reason for hiding this comment

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

@cacieprins Is there more than this line that chagnes? cy.get('#dom').should('contain', 'DOM') which we removed in a few of the other tests? Wondering if I missed it when eye-balling the differences

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The _parent test elements were changed in the fixture to load empty.html instead of dom.html - so they would not load the cached dom.html that does not have the cross-origin support script. The tests that used to assert that dom.html was loaded were changed to assert that empty.html was loaded instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While the final test was the flaky one, previous tests relied on the same portion of the fixture, so had to be modified as well.

Copy link

cypress bot commented Jan 11, 2024

29 flaky tests on run #53419 ↗︎

0 29005 1353 0 Flakiness 29

Details:

Update 1244.cy.js
Project: cypress Commit: 448bc0bb16
Status: Passed Duration: 19:09 💡
Started: Jan 11, 2024 3:02 PM Ended: Jan 11, 2024 3:22 PM
Flakiness  e2e/origin/origin.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
cy.origin > withBeforeEach > passes runnable state to the secondary origin on retry Test Replay
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-electron

View Output

Test Artifacts
... > correctly returns currentRetry Test Replay
... > correctly returns currentRetry Test Replay
... > correctly returns currentRetry Test Replay
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
network stubbing > waiting and aliasing > yields the expected interception when two requests are raced Test Replay
Flakiness  e2e/origin/origin.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
cy.origin > withBeforeEach > passes runnable state to the secondary origin on retry Test Replay
Flakiness  commands/waiting.cy.js • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
... > errors > throws when waiting for 2nd response to route Test Replay

The first 5 flaky specs are shown, see all 17 specs in Cypress Cloud.

Review all test suite changes for PR #28694 ↗︎

@cacieprins cacieprins changed the title chore: rewrite flaky 1244 test to no longer be flaky test: rewrite flaky 1244 test to no longer be flaky Jan 11, 2024
@cacieprins cacieprins merged commit 33f132d into develop Jan 11, 2024
4 checks passed
@cacieprins cacieprins deleted the cacie/chore/flaky-1244-test branch January 11, 2024 16:31
@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.

4 participants