Open WillsB3 opened 2 years ago
I can't spot any problems in your launcher script.
This could be caused by the tests doing something that prevents node from stopping the process, e.g. running a server or attaching a callback to a promise that is never resolved. The easiest way to fix this would be to add the exit
option to your mocha configuration - that will force the process to exit after the test run has finished.
Not sure if there's a better place to ask this
No, this is exactly the right place for this question :)
Hi,
Firstly, thank you for your work on Mocha Test Explorer for VSCode and these associated repos.
Apologies for cluttering up your GitHub issues - Not sure if there's a better place to ask this. If there is please close and point me there :).
I have written a simple custom launcher script which does some preprocessing to the environment variables used as part of the test run but I'm having a problem where debugging (using vscodes step-through debugging tools) works fine the first time but then stops working on subsequent attempts.
I've narrowed down the issue and it seems that when the Mocha debugging test run finishes the remote process never closes. This causes the next run to not be able to attach to the Node debugger as the port is already in use by the instance of the remote process created by the first run.
Here's the pertinent bits of my custom launcher code:
On subsequent debugging attempts using this custom launcher script I see the following log output in the
Mocha Tests
output channel in VSCode:I can also see the process still running in vscode, even though the tests have finished being debugged/run.
I can further validate that the process is still listening on the debugger port:
If I kill the process and retry the debugging it will work again for a single time.
Am I missing something in my custom launcher script or does the problem lie somewhere else?
Many thanks