vscode-go
vscode-go copied to clipboard
Go Test Explorer shows wrong state 'running' after it errors refusing to run multiple tests with debugger
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
- Run
go versionto get version of Go from the VS Code integrated terminal.- go version go1.17.1 linux/amd64
- Run
gopls -v versionto get version of Gopls from the VS Code integrated terminal.- golang.org/x/tools/gopls v0.7.5
- Run
code -vorcode-insiders -vto get version of VS Code or VS Code Insiders.- 1.63.2 899d46d82c4c95423fb7e10e68eba52050e30ba3 x64
- Check your installed extensions to get the version of the VS Code Go extension
- go v0.30.0
- Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Toolscommand.- too long and seemingly irrelevant
Share the Go related settings you have added/edited
Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.
Describe the bug
The Go test runner doesn't support debug of multiple tests, according to a red message that appears when trying it. However, after the red message appears and go extension fails, the vscode test runner shows the test as running, and the stop button doesn't operate. vscode has to be relaunched to recover.
This use case suggests a deeper issue with extension error handling.
Steps to reproduce the behavior:
- Load a project with 2 or more unit tests that the vscode "Testing" panel can run, and can debug a single test
- At the top level container in Testing panel, click the Debug Test icon to attempt to run all the tests with a debugger attached
Screenshots or recordings

Thanks for the report @jimsnab
Currently the code is written in a way to require users to act on the error message prompt (await vscode.window.showErrorMessage(...)). So, you will need to close the popup to bring the text explorer back to the initial state.
I see two issues involved here
- Should we wait for
vscode.window.showErrorMessageto be resolved? Maybe not. - Allow to debug multiple tests. At least, when debug/profile are requested in a single package level, we may consider package-level debugging.
cc @firelizzard18
Debugging multiple tests is definitely something I planned on. I was intending to do that after updating the old test support to use the new test explorer machinery. Unfortunately my day job leaves me very little time for side projects.
This is resolved in #3523. Debugging multiple tests within the same package works, and attempting to debug multiple tests within different packages will A) properly end the run and B) show an error in the UI: