Open sgermain06 opened 3 years ago
@sgermain06 I believe I'm in the same scenario. I too use WSL (WSL2 to be precise) and this is my first time using the Mocha Test Explorer.
The symptom I see is that when I start VSCode and I look at the "Mocha Log Explorer" Output window, I see this for every test (and one per it(...)
that I have):
[2021-07-08 13:47:50.097] [INFO] Worker: Looking for /path/to/project/test-integration/assignment-stats.js in Error
at findCallLocation (/home/me/.vscode-server/extensions/hbenl.vscode-mocha-test-adapter-2.13.0/out/worker/bundle.js:903:17)
at /home/me/.vscode-server/extensions/hbenl.vscode-mocha-test-adapter-2.13.0/out/worker/bundle.js:894:30
at Suite.<anonymous> (/path/to/project/test-integration/assignment-stats.js:69:5)
at Object.create (/path/to/project/node_modules/mocha/lib/interfaces/common.js:112:19)
at context.describe.context.context (/path/to/project/node_modules/mocha/lib/interfaces/bdd.js:40:27)
at /home/me/.vscode-server/extensions/hbenl.vscode-mocha-test-adapter-2.13.0/out/worker/bundle.js:892:37
at Object.<anonymous> (/path/to/project/test-integration/assignment-stats.js:52:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at /path/to/project/node_modules/mocha/lib/mocha.js:250:27
at Array.forEach (<anonymous>)
at Mocha.loadFiles (/path/to/project/node_modules/mocha/lib/mocha.js:247:14)
at Mocha.run (/path/to/project/node_modules/mocha/lib/mocha.js:576:10)
at /home/me/.vscode-server/extensions/hbenl.vscode-mocha-test-adapter-2.13.0/out/worker/bundle.js:5786:23
at Generator.next (<anonymous>)
at fulfilled (/home/me/.vscode-server/extensions/hbenl.vscode-mocha-test-adapter-2.13.0/out/worker/bundle.js:115:58)
The weird thing is that some of my tests run just fine under Mocha Explorer, yet others just hang. For those that hang I see this spit out:
[2021-07-08 14:11:18.819] [INFO] Worker: Using the mocha package at /path/to/project/node_modules/mocha
[2021-07-08 14:11:18.861] [INFO] Worker: Loading files
[2021-07-08 14:11:18.861] [INFO] Worker: Running tests
[2021-07-08 14:11:19.644] [INFO] Received {"type":"finished"}
But yet the circle next to the test in the explorer is still a blue circle with ellipsis in it, and the "stop" icon (red square) remains in the title bar of the explorer section.
For the ones that hang, I confirm that on the command-line I can run them just fine.
@sgermain06 My mistake, my issue wound up being something different (detailed in #173)
I've been using this extension for quite a while now and, since one of the latest updates of vscode, the process doesn't seem to clean up properly after a test. I'm not 100% sure if this could be caused by another plugin or what, but if anyone has seen something like this before, please let me know. I try to run my APIs in vscode and the instance of node that was started by the test adapter is the one answering the call, causing all kinds of problems.
Also, when I try to debug a test, the node process hangs and there's no other way to kill it than to close that vscode window, kill the node process on the command line and restart vscode.