node -v: v13.7.0npm -v: 6.13.6npm ls jest or npm ls react-scripts (if you haven鈥檛 ejected): [email protected] / [email protected] (see below)your vscode-jest settings if customized:
Not customizedNot customizedMulti-root project, with Jest 25 on its own on back-end and react-scripts on the front-endOperating system: Ubuntu 18.04
Yesnpm run test or node_modules/.bin/jest) npm run testNot sure how to create a relevant repository. Would appreciate guidance on the diagnostic path. I've tried enabling debug, nothing suspicious emerges.
Jest runs correctly in the extension. Icons are fine, test results are reported correctly. Upon termination of VS Code, no Jest processes are left behind.
Jest runs correctly in the extension. Icons are fine, test results are reported correctly.
Upon termination of VS Code, I am left with a number of ghost processes. See below for the output of ps aux:
paolo 14981 22.6 0.7 981876 128424 tty2 Sl+ 09:55 0:06 node /home/paolo/react/CongressGuru/congress-guru/backend/lambdas/node_modules/.bin/jest --testLocationInResults --json --useStderr --outputFile /tmp/jest_runner_lambda.json --watch --coverage --no-color --reporters default --reporters /home/paolo/.vscode/extensions/orta.vscode-jest-3.1.1/out/reporter.js
paolo 15418 0.2 0.1 587628 24740 tty2 Sl+ 09:55 0:00 node /home/paolo/react/CongressGuru/congress-guru/frontend/node_modules/.bin/react-scripts test --testLocationInResults --json --useStderr --outputFile /tmp/jest_runner_front_end.json --watch --coverage --no-color --reporters default --reporters /home/paolo/.vscode/extensions/orta.vscode-jest-3.1.1/out/reporter.js
paolo 15425 8.1 0.4 954260 68880 tty2 Sl+ 09:55 0:01 node /home/paolo/react/CongressGuru/congress-guru/frontend/node_modules/react-scripts/scripts/test.js --testLocationInResults --json --useStderr --outputFile /tmp/jest_runner_front_end.json --watch --coverage --no-color --reporters default --reporters /home/paolo/.vscode/extensions/orta.vscode-jest-3.1.1/out/reporter.js
The only solution I have found is running a pkill node.
The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...
That's not good at all @pdemarino!
Would you be able to try reproducing it to see if it will happen without the multi-root project? As for other guidance for how to troubleshoot this, I'd suggest running running the extension in development mode and setting a few breakpoints where we'd expect the extension to close or clean up.
@pdemarino, I have the same problem. One more solution by this issue is that: Launch VS Code in a project folder with bash command such as that:
$ code --wait . && pkill -f "bin\/jest" &
After exiting from VS Code all Jest runner processes would be killed automatically.
Noticed the same issue for couple of months now:
501 56707 1 0 Wed10AM ?? 10:24.90 node /Users/renarsvilnis/work/project-1-fe/node_modules/react-scripts/scripts/test.js --testLocationInResults --json --useStderr --outputFile /var/folders/c2/xwc5xfcn7zj6_tzdgm0bzgj40000gn/T/jest_runner_rma_portal_fe.json --watch --no-coverage --no-color --reporters default --reporters /Users/renarsvilnis/.vscode/extensions/orta.vscode-jest-3.1.1/out/reporter.js
501 91865 1 0 10:36AM ?? 1:18.45 node /Users/renarsvilnis/work/project-2-fe/node_modules/react-app-rewired/scripts/test.js --testLocationInResults --json --useStderr --outputFile /var/folders/c2/xwc5xfcn7zj6_tzdgm0bzgj40000gn/T/jest_runner_amplifi_com_controller_fe.json --watch --no-coverage --no-color --reporters default --reporters /Users/renarsvilnis/.vscode/extensions/orta.vscode-jest-3.1.1/out/reporter.js
501 93060 1 0 Wed11AM ?? 10:08.02 node /Users/renarsvilnis/work/project-1-fe/node_modules/react-scripts/scripts/test.js --testLocationInResults --json --useStderr --outputFile /var/folders/c2/xwc5xfcn7zj6_tzdgm0bzgj40000gn/T/jest_runner_rma_portal_fe.json --watch --no-coverage --no-color --reporters default --reporters /Users/renarsvilnis/.vscode/extensions/orta.vscode-jest-3.1.1/out/reporter.js
All frontend apps using bootstrapped create-react-app typescript app thus the react-scripts.
I've had the same issue, as well - I wasn't even using this plugin directly because in this particular project we have a complex Jest setup, but I was simply running jest from the command line. I was finding that connections were being left open to the DB so I tracked down the parent process which pointed to this plugin. I've had this issue with both Jest 24 and Jest 25 and we are using ts-jest. I'm on macOS 10.15.3. Removing the plugin has solved the issue.
hmmm... I can't reproduce this with a react-native monorepo project... wondering:
@connectdotz
react-scripts projects for me at least all of them are typescript based. Not sure how react-scripts handles that under the hood - compiles with babel or ts-jest.not using React here - this is for a GraphQL API
This could be related to my https://github.com/jest-community/vscode-jest/issues/455#issuecomment-614904752 where I can consistently reproduce a similar (and more severe) issue with process leaks by toggling coverage report.
thanks for everybody's data points, I was able to reproduce this and observed these 2 types of behaviors:
@jeantil I could not reproduce your observation with coverage toggle, but I suspect it probably falls into one of the categories mentioned above...
Apology if this has happened to your project, I am afraid you will have to manually kill these orphan processes for now (such as pkill -f jest or pkill -f jest_runner). I will take a look to see how we can address this ASAP...
hi, we have a new release candidate with the fix: v3.2.0. Would appreciate more testing before release, please feel free to give it a try and let us know if it worked, or not...
(to try the new release candidate, just to install the .vsix file (vscode-jest-3.2.0.vsix) in your vscode: https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix)
@connectdotz
I did install v3.2.0, Jest tests are still running by themselves in the background.
Most helpful comment
thanks for everybody's data points, I was able to reproduce this and observed these 2 types of behaviors:
@jeantil I could not reproduce your observation with coverage toggle, but I suspect it probably falls into one of the categories mentioned above...
Apology if this has happened to your project, I am afraid you will have to manually kill these orphan processes for now (such as
pkill -f jestorpkill -f jest_runner). I will take a look to see how we can address this ASAP...