-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Improve slow CaseViewPage jest tests #150952
[Cases] Improve slow CaseViewPage jest tests #150952
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
}); | ||
|
||
userEvent.click(result.getByTestId('edit-connectors-submit')); | ||
expect(await screen.findByTestId('connector-fields-resilient')).toBeInTheDocument(); |
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.
findByTestId
does a waitFor
internally so this may be a performance improvement 🤷♂️ maybe more a readability improvement.
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.
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.
This is amazing @jonathan-buttner! I learned so much 🙂. Inspired by @mikecote, maybe you can add a for-loop around the test to run it on the CI multiple times and then remove it to be sure the test is not flaky. Example f9372b2.
|
||
const dropdown = screen.getByTestId('case-view-status-dropdown'); | ||
userEvent.click(dropdown.querySelector('button')!, undefined, { | ||
skipPointerEventsCheck: true, |
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.
This is great!!
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.
Awesome work!! 🎉
💔 Build FailedFailed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: |
const license = licensingMock.createLicense({ | ||
license: { type: 'platinum' }, | ||
}); | ||
for (let i = 0; i < 500; i++) { |
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 this 😄
Fixes: 149782, 149781, 149780, 149778, 149779, 149777, 149776, 149775, 149773, 149774, 149772, 149771, 149770, 149769
This PR attempts to speed up some slow tests for the
CaseViewPage
component.The
should update connector
test was reporting a failure for exceeding the 5000 timeout. I tried moving some things out of the beforeEach, using screen, and addingskipPointerEventsCheck: true
which according to the docs can be a performance improvementThe other thing I noticed was that when a test exceeds the timeout it can cause tests after it to fail. I'm not sure why but I was able to reproduce this:
I think that's what's happening with the CI failure here: https://buildkite.com/elastic/kibana-on-merge/builds/26147#0185f527-6859-4d01-ac37-e5483a535e48
Example performance improvements
New performance
Old performance