Need to clear timeout in DebugClient.waitForEvent

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

Nobody has claimed this yet.

Assessment

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

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.

Description

feature-request

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.

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

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.

More from microsoft/vscode-debugadapter-node

All issues in microsoft/vscode-debugadapter-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.