Closed capaj closed 10 months ago
I'm going to transfer this to the profiling node repo, thanks for opening an issue! cc @JonasBa
@capaj do I understand correctly when you say that it crashes after some random number of test restarts? And do you mind me asking what version of node were you seeing the crash on?
Yes it crashes after roughly 10 runs
I have node 20 but it reproduces on 18 too
Yup, I managed to reproduce. I dont know for sure, but I suspect this might be related to how vitest spawns threads to run tests (I haven't looked into how vitest works yet) and we don't clean up the napi instance data correctly.
@capaj mind upgrading to 1.3.3 and testing this? I just tested the code you provided and failed to reproduce the issue.
I still have the same error. After I have disabled profiling (on dev), errors stopped from happening.
Errors were also followed by ECONNRESET and ECONNREFUSED in node console.
Didn't notice same error on production.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
7.92.0
Framework Version
vitest any
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
I tried to setup a minimal repro here: https://stackblitz.com/edit/vitest-dev-vitest-1gd3e9?file=src%2Fsentry.ts
but I failed, because profiling integration does not run on stackblitz. So what you need to do:
Expected Result
Vitest does not crash
Actual Result
vitest crashes after a few runs Screencast from 5.1.2024 17:53:35.webm