-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Running tests crashes node w/ JSDOM and vue 2 vite plugin #1171
Comments
We can’t hep you without a reproduction. Try at least to create a minimal reproduction. |
I'm seeing the same error in a Vue 3 project, both with It's worth mentioning, that I'm only getting this error when running @ScottAwesome can you confirm this? (kind reminder to do a EDIT: Seems to happen after a few runs, easiest to trigger in watch mode. |
@sheremet-va the problem is I can't give access to a direct copy of the repository due to company restrictions. I tried to make a reproduction on stackblitz but it wants me to have a pro account due to the number of files. Open to other suggestions |
@sua-dawn still happens with node 16, 17, and 18 |
I can confirm that Jest runs the test fine. |
Just before shutting down for the day, yesterday, I did encounter a single error using Just for comparison here's my system info:
(different architecture, and different node-version manager... so those can probably be excluded as causes) Click to expand full error output
Today I've gone through all test skipping all but one, the error occurred eventually on all individual tests - if that helps anything. |
I wonder if its the worker pool situation based on the following:
I'm not sure how to introspect the run in such a way I can log dump on that though |
@ScottAwesome I think you're right.
|
Hmm, couldn't it be this: vitest/packages/vitest/src/node/pool.ts Line 104 in 5cc592b
It's not awaited here: Sorry if this is unrelated, just browsing around atm. |
@kswope appreciate the effort, but the linked repo errors out because the async supertest request isn't handled (returned or awaited).
test("crashes with then or catch", async () => {
try {
const res = await request(app()).get("/user")
console.log(res.body)
} catch (err) {
// ...
}
}) test("crashes with then or catch", () => {
return request(app())
.get("/user")
.then((res) => console.log(res.body)) // comment to prevent crashing
.catch() // comment to prevent crashing
}) EDIT: Callback example removed, deprecated from |
Ok the errors to me looked similar but I guess they aren't the same. I was looking at only what @ScottAwesome posted. I guess with vitest not returning a pending supertest promise ends up with a horrible crash but in jest it doesn't - live and learn. At least with vitest you don't have to babel everything :) |
FYI: This is still an issue in |
We made a change in the latest version that should help with that, can you verify please? |
@sheremet-va just tried out |
Hey guys. Join this sad club. The same problem - this error appears from time to time. Differences: macOS 12.3.1, M1 Pro processor, The stack is always different. Examples
I would be happy to provide any additional information. |
For me, this error only occurs when I try to create a coverage report, but it only happens occasionally (sometimes on every run, sometimes on every second or third run). Version: Configuration: defineConfig({
// ...,
test: {
globals: true,
environment: 'jsdom',
reporters: 'verbose',
testTimeout: 2000,
include: [`${PWD}/src/**/*.{spec,test}.{ts,tsx}`, `${PWD}/tests/**/*.{spec,test}.{ts,tsx}`]
},
// ...,
}) |
I'm hitting the same overall issue. We've reverted back to Jest now that |
Hitting a similar issue w/ React and jsdom. When I turn on coverage, I get random test timeouts. If you look at the logs below, the error should not be happening---the test itself has a timeout of 35s. The interaction that failed has a timeout of 15s... but the test is timing out after 5s! Note that this only happens when I turn coverage on: Update: looks like I mispoke... upon closer inspection what's happening is that the UI change has already happened by the time the assertion runs. It appears that w/ coverage turned on, the UI is updating at the same rate but test assertions are running slower? (That sort of makes sense.... but unfortunately, it keeps us from being able to use coverage.)
|
Running into this, too:
What's actually curious is that uninstalling Here's the stack trace, just in case
|
I know this sounds like some "aliens stole my nostril" scenario, BUT adding |
I'm dropping this issue, it seems to be working okay now, we are anticipating that support here will be better with vue 2.7 and the official vite plugin. |
I'm getting this issue with node 16 and vitest, node environment |
I had been experiencing this issue, but it was resolved after upgrading to Node 16.17.0 (due to this fix: nodejs/node#42874) |
Describe the bug
The issue I keep running into is my tests keep crashing whenever I run vitest. I have also noticed that my tests are not properly isolated from one another, and I'm using
@testing-library/vue
version 5.8.2 as well as@testing-library/jest-dom
for additional matchers. I end up in situations where I can see clearly from the error messages from@testing-library/vue
that its re-rendering my components in a non isolated fashion.Note that all of these tests run fine when using Jest.
My config
This is the error I run into whenever I run tests. its not a ton of tests, its approximately 74 total
Reproduction
Between my companies policy of privacy around the repository in question and the fact we use a custom registry with pre-built dependencies (so the dependencies are not available on github) I'm not able to really at a reproduction.
What I can do is partner with a repo maintainer to troubleshoot the issue in a live session, though I get why this is way less than ideal. I'm going to try and see if I can get something up by reproducing it via hard extracting some packages we pre-built (this may be feasible).
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: