-
Notifications
You must be signed in to change notification settings - Fork 365
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
test: Improve unit test stability when running locally #10278
Changes from 12 commits
df9f692
573d3a8
bc587ae
dda9138
00664b5
e583433
51c6007
3960d8e
1c4e758
686fcd7
4e63e1d
f7b8509
0cdb44e
a40637f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Tests | ||
--- | ||
|
||
Improve unit test suite stability ([#10278](https://github.com/linode/manager/pull/10278)) |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,9 +107,10 @@ describe('Longview clients list view', () => { | |
expect(props.getLongviewClients).toHaveBeenCalledTimes(1); | ||
}); | ||
|
||
it('should have an Add Client button', () => { | ||
const { queryByText } = renderWithTheme(<LongviewLanding {...props} />); | ||
expect(queryByText('Add Client')).toBeInTheDocument(); | ||
it('should have an Add Client button', async () => { | ||
const { findByText } = renderWithTheme(<LongviewLanding {...props} />); | ||
const addButton = await findByText('Add Client'); | ||
expect(addButton).toBeInTheDocument(); | ||
Comment on lines
+110
to
+113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This occasionally fails because |
||
}); | ||
|
||
it('should attempt to add a new client when the Add Client button is clicked', async () => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I spent the most time troubleshooting this test and found that it fails by timing out nearly every time when running alongside the rest of the test suite. (The quickest way to reproduce I've found is to run What I've found is that the test, interactions, etc. all work exactly as expected, but when running alongside other tests some of the interactions (specifically and surprisingly the My (purely speculative) guess is that when transpiling/running a lot of tests concurrently, the CPU is taking such a hit that it's slowing down JSDom to the point that the tests are timing out. I opened a ticket to reassess Happy DOM which might prove or disprove this theory, but in the meantime increasing the timeout seems to be a reliable (if unfortunate) mitigation. |
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.
Resolves these warnings: