-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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(setup): fix server closure #3056
Conversation
await new Promise((resolve) => { | ||
server.close(resolve) | ||
}) | ||
if (vite) { | ||
await vite.close() | ||
} |
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 think you can shorten this to
await new Promise((resolve) => { | |
server.close(resolve) | |
}) | |
if (vite) { | |
await vite.close() | |
} | |
await new Promise((resolve) => server.close(resolve)) | |
await vite?.close() |
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 didn't use an optional chain because of pre-Node-14 environments – is this file transpiled by Jest?
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.
ah okay, I'm so used to TypeScript ^^
Failed on windows because of the 30000 ms general jest timeout, we should bump it to 40000 at least. We may do that in another PR |
On the windows runner there was an error https://github.com/vitejs/vite/pull/3056/checks?check_run_id=2384573026#step:10:29 FAIL packages/playground/ssr-react/__tests__/ssr-react.spec.ts
● Test suite failed to run
Timeout - Async callback was not invoked within the 30000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 30000 ms timeout specified by jest.setTimeout.
at mapper (node_modules/jest-jasmine2/build/queueRunner.js:27:45) @patak-js 30s are already very high, isn't it? 🤔 |
Looks like 30 sec is not enough, no? |
But what is it waiting for? Will this occur in real production environment? |
Hey I will re-run the job and look if the windows runner fails with the same timeout-issue Works ✔️ |
@nihalgonsalves since checks have passed, I think you could make this one ready for review and work on further improvements in another PR |
@nihalgonsalves Thanks this has been quite a pain ❤️ CC @dominikg |
Description
Attempt to fix test teardown issues.
The current failures can be reliably reproduced using:
This fixes that case.
Additional context
Fixes these errors:
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).