Implement LSP debug test commands#69267
Conversation
| <data name="Aborted" xml:space="preserve"> | ||
| <value>Aborted!</value> | ||
| </data> | ||
| <data name="Attaching_debugger_to_process" xml:space="preserve"> |
There was a problem hiding this comment.
It looks like should be called
Attaching_debugger_to_process_0
| if (attachDebugger) | ||
| { | ||
| // When we want to debug tests we need to use a custom test launcher so that we get called back with the process to attach to. | ||
| vsTestConsoleWrapper.RunTestsWithCustomTestHost(testCases, runSettings: null, handler, new DebugTestHostLauncher(progress, clientLanguageServerManager)); |
There was a problem hiding this comment.
Just to check, O# also doesn't support runSettings, is that correct?
There was a problem hiding this comment.
O# does, but I haven't implemented it yet here. That will be my next followup.
| // Send an explicit request to the client to tell it to attach to the debugger and wait for the response. | ||
| // We want to wait for the attach to complete before we continue. | ||
| var task = Task.Run(async () => await AttachDebuggerAsync(processId, cancellationToken), cancellationToken); | ||
| return task.WaitAndGetResult_CanCallOnBackground(cancellationToken); |
There was a problem hiding this comment.
I haven't looked at the client-side PR. But it feels like
the client-side debug test command is waiting for the server debug test, and the server then waits for the client to attach the debugger to the process. 🤔 Are the 'debugger attaching' work lives in a separate thread?
There was a problem hiding this comment.
I just feel this looks like a deadlock, maybe it's fine as long as you test that works😄
There was a problem hiding this comment.
Not 100% sure on the question - but yes the client is not fully blocked waiting for the run tests command to complete. It needs to be able to handle the partial results (e.g. the logging) and this debug attach request while its waiting for the overall request to complete.
|
A few minor questions and I will sign this off after they get answer :) |
Implements server side of test debugging. Part of dotnet/vscode-csharp#5719
See the client PR for a gif - dotnet/vscode-csharp#5965