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: Use resolved git root on Windows #26179

Merged
merged 4 commits into from
Mar 27, 2023
Merged

Conversation

mike-plummer
Copy link
Contributor

Additional details

Flaky test does not reproduce locally on M1, but from logs I believe the issue is that we are initializing the gitBaseDir field asynchronously, which means Git commands run immediately after creation might execute against the cypress repository rather than the scaffolded project.

Currently, we use the resolved Git repo root as cwd for bulk Git ops on Unix, but the project directory on Windows which could be incorrect based on project structure.

  • Initialize GitDataSource's base dir to the project directory, replaced by existing logic during async setup flow
  • Cleanup GitDataSource tests
    • use async fs APIs
    • await callback promises rather than polling
    • await cleanup items between tests

Steps to test

Existing tests should cover

How has the user experience changed?

No user-facing change, should only impact unit tests due to quick execution of test before async setup flow completes and replaces git repo root

PR Tasks

@cypress
Copy link

cypress bot commented Mar 22, 2023

30 flaky tests on run #44973 ↗︎

0 26895 1281 0 Flakiness 30

Details:

Merge branch 'develop' into mikep/23317-flaky-git-test
Project: cypress Commit: 8bf4d0692e
Status: Passed Duration: 19:03 💡
Started: Mar 27, 2023 4:53 PM Ended: Mar 27, 2023 5:12 PM
Flakiness  project-setup.cy.ts • 1 flaky test • launchpad-e2e

View Output Video

Test Artifacts
... > skips the setup page when choosing e2e tests to run Output Screenshots Video
Flakiness  global-mode.cy.ts • 1 flaky test • launchpad-e2e

View Output Video

Test Artifacts
... > can be opened Output Screenshots Video
Flakiness  e2e/origin/cookie_login.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output Video

Test Artifacts
cy.origin - cookie login > Max-Age > past max-age -> not logged in Output Video
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output Video

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse Output Video
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-chrome:beta

View Output Video

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

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

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

Copy link
Contributor

@astone123 astone123 left a comment

Choose a reason for hiding this comment

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

Nice 👍🏻

Copy link
Contributor

@warrensplayer warrensplayer left a comment

Choose a reason for hiding this comment

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

One comment, but not a blocker. I like the updates to the test.

@mike-plummer mike-plummer merged commit 91cc2e2 into develop Mar 27, 2023
@mike-plummer mike-plummer deleted the mikep/23317-flaky-git-test branch March 27, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants