microsoft / microsoft/vscode-debugadapter-node

Need to clear timeout in DebugClient.waitForEvent

Open
#209 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
TypeScript
Stars
306
Forks
90
Avg merge
8h 36m
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect testSupport/src/debugClient.ts at the DebugClient.waitForEvent timer around lines 292-299. Run the relevant unit tests with mocha and verify that receiving the event cancels the timer, resolves the promise, and lets the Node process exit without waiting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.