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

Cypress Flaky tests need to be updated #2900

Closed
josh-bagwell opened this issue Aug 30, 2024 · 0 comments · Fixed by #3034
Closed

Cypress Flaky tests need to be updated #2900

josh-bagwell opened this issue Aug 30, 2024 · 0 comments · Fixed by #3034
Assignees
Labels
12.x bug Something isn't working review in progress Code is currently under review

Comments

@josh-bagwell
Copy link
Contributor

🐛 Bug Report

There are flaky tests currently after the Webpack update. This is most likely due to how fast the component runner is and will need checks before running the set of tests so React can render the component updates.

Expected Behavior

There are currently flaky tests and ActionBar has failing tests. These will need to be removed.

Actual Results

The cause of the Flaky tests seem to be with how quickly the Component Runner moves through each test. This does not give React enough time to update each state of the components.

@josh-bagwell josh-bagwell added bug Something isn't working 12.x labels Aug 30, 2024
@josh-bagwell josh-bagwell added this to the 12.0.0 milestone Aug 30, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Canvas Kit Aug 30, 2024
@jaclynjessup jaclynjessup moved this from 🆕 New to 🔖 Ready in Canvas Kit Sep 5, 2024
@josh-bagwell josh-bagwell linked a pull request Sep 12, 2024 that will close this issue
@josh-bagwell josh-bagwell moved this from 🔖 Ready to 🏗 In progress in Canvas Kit Sep 12, 2024
@josh-bagwell josh-bagwell self-assigned this Sep 12, 2024
@josh-bagwell josh-bagwell moved this from 🏗 In progress to 📋 To Do in Canvas Kit Sep 25, 2024
@github-actions github-actions bot closed this as completed Nov 5, 2024
@github-project-automation github-project-automation bot moved this from 📋 To Do to ✅ Done in Canvas Kit Nov 5, 2024
@josh-bagwell josh-bagwell removed a link to a pull request Nov 6, 2024
@josh-bagwell josh-bagwell removed this from the 12.0.0 milestone Nov 6, 2024
@josh-bagwell josh-bagwell reopened this Nov 6, 2024
@jaclynjessup jaclynjessup moved this from 🏗 In progress to 🆕 New in Canvas Kit Nov 6, 2024
@josh-bagwell josh-bagwell moved this from 🆕 New to 🏗 In progress in Canvas Kit Nov 6, 2024
@josh-bagwell josh-bagwell added the review in progress Code is currently under review label Nov 25, 2024
alanbsmith pushed a commit that referenced this issue Nov 27, 2024
Fixes: #2900  

This is adding fixes for the Cypress flaky specs that were caused from the [Webpack Upgrade](#2674).

This is addressing Flaky results for Cypress. A test is considered to be flaky when it can pass and fail across multiple retry attempts without any code changes. For example, a test is executed and fails, then the test is executed again, without any change to the code, but this time it passes. See more about Flaky [here](https://docs.cypress.io/cloud/features/flaky-test-management).

A Flaky result only happens in the CI and not in local since running Cypress locally only gives `pass` or `fail` results.

We had recently switched from E2E tests (end-to-end) to Component tests when upgrading [Storybook](#2674) and this had created flaky results on some of our components. We think this may be due to the nature of the Component runner as it is so much quicker than E2E. Due to it's nature of being much quicker, it resulted in flaky results due to our components not being to move as quick as the component runner. There may be times where the Component runner would move quicker than an item being focused in a menu or an item switching focus from one item to the next. 

To address the Flaky issues, there have been updates made to some Component Specs:
- Be more explicit with contexts (making sure that each line could be something that a user would do)
- Rely on the use of `findByRole()` instead of using `get()`. This allows us to be more specific about what element it is grabbing
- Removing deeply nested contexts and moving out to it's own context. This way we are not using more `beforeEach` than is needed and improves legibility.

[category:Test]
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Canvas Kit Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
12.x bug Something isn't working review in progress Code is currently under review
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant