Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsupport: allow disabling timeouts with stdio connection #286

Open
justarandomgeek opened this issue Jan 17, 2023 · 4 comments
Open

testsupport: allow disabling timeouts with stdio connection #286

justarandomgeek opened this issue Jan 17, 2023 · 4 comments

Comments

@justarandomgeek
Copy link

I've been struggling significantly with getting the testsupport client to run my debugadapter, and in the process have needed to attach a debugger to my debug adapter running under the testsupport client, but it does not run in network mode, so I keep getting cut off by the timeouts from testsupport, and i can't seem to disable them. Additionally, when I set the timeout to a very long time (several minutes), it hangs the process for that long after debugging ends, even if nothing else is going on.

@roblourens
Copy link
Member

Sorry, which timeouts from testsupport? And it's not clear why that is hanging the process. It has been a bit since I looked at this code, apologies, but I want the dev experience to be good.

@justarandomgeek
Copy link
Author

The ones that it says it disables when using a tcp port in .start()?

I've once again done a horrible hack for now, but... seriously? having to do silly stuff like this is nuts!

await dc.start();
// fake "socket" to disable timeouts
(dc as any)._socket = { end: ()=>{} };

@justarandomgeek
Copy link
Author

justarandomgeek commented Jan 18, 2023

Further investigation has revealed that these timeouts were merely a red herring for my actual issue (stdin pipes breaking due to testrunner console weirdness), but an option to disable them for testing still seems worthwhile.

@justarandomgeek
Copy link
Author

justarandomgeek commented Jan 21, 2023

The hang occurs becuase:

  1. A test runs to a point where the debugee exits
  2. The adapter emits a Terminated event, and itself exits (gracefully, so that i can get coverage info from tests too - if i wait for .stop to kill it i get none because on windows a kill is really a kill)
  3. The test suite calls DebugClient.stop() (because the example showed that, and because some tests might not run to termination)
  4. The DebugClient sends a disconnect request to the dead adapter, and waits for the long timeout

public stop(): Promise<void> {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants