microsoft / vscode-debugadapter-node

Debug adapter protocol and implementation for VS Code.
Other
273 stars 79 forks source link

Need to clear timeout in DebugClient.waitForEvent #209

Open simark opened 5 years ago

simark commented 5 years ago

I am using DebugClient in some unit tests, and noticed that my test runner (mocha) took some time to exit after the tests completed successfully. I traced it to this timer in DebugClient.waitForEvent. It is never cancelled, so the node process waits for it to expire before exiting.

https://github.com/Microsoft/vscode-debugadapter-node/blob/64665fe18a0316b2a871df4b36cff214c28d2598/testSupport/src/debugClient.ts#L292-L299

Ideally, it would be cancelled when the event is received and the promise is resolved. I can't sign the CLA required to contribute to this repository, so I can't contribute a patch, but the changes required are very simple.