test(setup): fix server closure#3056
test(setup): fix server closure#3056patak-cat merged 1 commit intovitejs:mainfrom nihalgonsalves:jest-fix
Conversation
| await new Promise((resolve) => { | ||
| server.close(resolve) | ||
| }) | ||
| if (vite) { | ||
| await vite.close() | ||
| } |
There was a problem hiding this comment.
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.
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.
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).