-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Cases] Fix flakiness in all_cases_list.test.tsx
#157285
Conversation
@elasticmachine merge upstream |
all_cases_list.test.tsx
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified locally. It took some time to run whole test but didn't time out.
Great job!! 👏 🎉
@@ -705,7 +739,7 @@ describe.skip('AllCasesListGeneric', () => { | |||
}); | |||
}); | |||
|
|||
describe('Actions', () => { | |||
describe.each(Array(55).fill(null))('Actions', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget to remove it before merge 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Thanks!
// The JSDOM implementation is too slow | ||
// Especially for dropdowns that try to position themselves | ||
// perf issue - https://github.com/jsdom/jsdom/issues/3234 | ||
Object.defineProperty(window, 'getComputedStyle', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great finding!! 👏
perhaps we could try the same for xpack/plugins/cases/public/components/case_view/components/ case_view_activity.test.tsx
component as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcger told me about it! Yes I try to improve the case_view_activity.test.tsx
on another PR.
Why not use the flaky test runner? |
Unfortunately, the flaky test runner does not support unit tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have a nit
and everywhere we do await waitFor(() => screen.getBy(...
😅
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
## Summary This PR fixes the flaky tests in `x-pack/plugins/cases/public/components/all_cases/all_cases_list.test.tsx`. It modifies the `getComputedStyle` to be more performant. For more information see https://blog.sentry.io/sentrys-frontend-tests-migrating-from-enzyme-to-react-testing-library and jsdom/jsdom#3234. I run the test multiple times on CI to ensure that the test is not flaky anymore: Specifically: - Test run 50 times in ccf2716 - Test run 40 times in c56c650 - Test run 50 times in b04d613 - Test run 50 times in e0ef292 - Test run 55 times in 1ba6bac Fixes: #148096, #150923 ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR fixes the flaky tests in
x-pack/plugins/cases/public/components/all_cases/all_cases_list.test.tsx
. It modifies thegetComputedStyle
to be more performant. For more information see https://blog.sentry.io/sentrys-frontend-tests-migrating-from-enzyme-to-react-testing-library and jsdom/jsdom#3234.I run the test multiple times on CI to ensure that the test is not flaky anymore: Specifically:
Fixes: #148096, #150923
Checklist
Delete any items that are not applicable to this PR.
For maintainers