fix(pool): improve error message when worker exits unexpectedly#10587
Conversation
AriPerkkio
left a comment
There was a problem hiding this comment.
Test case for this could be in
vitest/test/e2e/test/pool-worker-exit.test.ts
Lines 1 to 71 in 5b81a63
... where stderr (or buildTree or was it buildError?) is asserted to contain the signals and exit code.
exit errorexit error
|
Thanks for the feedback and guidance @AriPerkkio! I have integrated your optional-code suggestion and was able to add a test to the test file you pointed to - very helpful, thanks. I validated at least this particular |
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
…h multiple arguments
…of the crash tests to use SIGINT instead of SIGKILL, assert on stderr contents to check exit code and signal on worker death
aa09561 to
cbac567
Compare
AriPerkkio
left a comment
There was a problem hiding this comment.
Overall looks good, one small additional improvement to make the error more detailed.
…uring worker death
eefba19 to
6c76bb0
Compare
6c76bb0 to
b946a3e
Compare
exit error
Description
In a large project leveraging vitest, with heavy integration test setup routines involved, we noticed sometimes the test worker threads would 'unexpectedly exit' but without much information. Poking around the code, it seems like the child-process-based pool workers expose
codeandsignaltoexitevents. Worker threads expose exit codes, though no signal.However, vitest doesn't expose that information in the case that forks or worker thread-based pool workers exit unexpectedly. This information was helpful for us to diagnose at least one test 'flakiness' issue we encountered (SIGSEGV when native extensions were dipping into global shared memory spaces).
This PR is a conversation starting point as I'm a first-timer contributor to vitest! I am missing a few things in the checklist below and am open to any feedback on how to make this PR easier to review / accept.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.main- which is ironic given what this PR does!Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.