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

chore: Fix flaky test #25726

Merged
merged 2 commits into from
Feb 6, 2023
Merged

chore: Fix flaky test #25726

merged 2 commits into from
Feb 6, 2023

Conversation

BlueWinds
Copy link
Contributor

Additional details

This PR fixes a single flaky test.

Basically, cypress-real-events doesn't reset the browser's cursor position between tests or retries, resulting in, in some circumstances, tests that flake depending on what exactly is run before or after them and where it positioned the virtual mouse. Also, this test would never pass while retrying.

This is why we don't use CDP for mouse events in Cypress core, despite the other advantages. Also, these tests don't work in Firefox at all.

Steps to test

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • [n/a] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [n/a] Has a PR for user-facing changes been opened in cypress-documentation?
  • [n/a] Have API changes been updated in the type definitions?

@BlueWinds BlueWinds requested review from warrensplayer and removed request for warrensplayer February 6, 2023 20:14
Copy link
Contributor

@marktnoonan marktnoonan left a comment

Choose a reason for hiding this comment

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

You could remove the cy.get('body').click('topLeft') and related comments from line 82 in this PR if you like, since your way actually works!

@BlueWinds
Copy link
Contributor Author

You could remove the cy.get('body').click('topLeft') and related comments from line 82 in this PR if you like, since your way actually works!

My eyes just completely skipped over that comment every time I read the test, hah. Removed in eccf3a0.

@cypress
Copy link

cypress bot commented Feb 6, 2023

42 flaky tests on run #43836 ↗︎

0 26785 1271 0 Flakiness 42

Details:

Remove old approach to fixing same flake
Project: cypress Commit: eccf3a0c16
Status: Passed Duration: 19:47 💡
Started: Feb 6, 2023 8:48 PM Ended: Feb 6, 2023 9:08 PM
Flakiness  scaffold-component-testing.cy.ts • 1 flaky test • launchpad-e2e

View Output Video

Test
scaffolding component testing > vuecli4vue2 > scaffolds component testing for Vue CLI 4 w/ Vue 2 project Screenshot
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test
network stubbing > intercepting request > can delay and throttle a StaticResponse
Flakiness  e2e/origin/patches.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test
... > patches fetch in the AUT when going cross origin and sends credential status to server socket > works as expected with requests that require preflight that ultimately fail and the request does not succeed
Flakiness  e2e/origin/commands/assertions.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

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

View Output Video

Test
... > correctly returns currentRetry
... > correctly returns currentRetry
... > correctly returns currentRetry

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

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@BlueWinds BlueWinds merged commit 4251180 into develop Feb 6, 2023
@BlueWinds BlueWinds deleted the flake-debug-tests branch February 6, 2023 21:13
tgriesser added a commit that referenced this pull request Feb 8, 2023
* develop: (28 commits)
  chore: update changelog validation example (#25742)
  fix: Improve error handling around calls to `this.next` in middleware (#25702)
  chore: debug page tooltip distance and artifact border (#25727)
  fix: update newProject ref when switching between organizations in SelectCloudProjectModal (#25730)
  misc: Add max widths to debug page message states (#25725)
  chore: export types (#25714)
  chore: release @cypress/webpack-preprocessor-v5.16.3
  chore: release @cypress/vue-v5.0.4
  chore: release @cypress/grep-v3.1.4
  chore: Fix flaky test (#25726)
  dependency(deps): update dependency debug to ^4.3.4 🌟 (#25699)
  feat: openInIDE for failed debug spec (#25691)
  test: fix flaky CT test by relying on query (#25706)
  test: fix flaky migration test (#25672)
  misc: style change for responsiveness (#25687)
  misc: set min widths for icons (#25684)
  chore(deps): update dependency markdown-it to v11.0.1 🌟 (#25698)
  chore: Fix flaky origin .wait() test (#25693)
  chore: unskip tests (#25676)
  chore: release @cypress/webpack-preprocessor-v5.16.2
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants