testing: Avoid concurrent go test
invocations when "Test on Save" is enabled
#1089
Labels
Milestone
go test
invocations when "Test on Save" is enabled
#1089
Is your feature request related to a problem? Please describe.
Some projects have tests that can not be run in parallel as they may require external resources (e.g. a listener port, or an external database, or a file on disk, or some other state/config in a second process)
When I enable "test on save" and save again quickly before the previous
go test
completes (that was automatically started when I saved previously), a newgo test
is invoked and this will often cause both the previous and the current invocations to (eventually) fail.Describe the solution you'd like
Either stop the previous
go test
run unconditionally before starting a new one, or give it as an option (e.g. by default maintain the current behavior that allow parallelgo test
invocations, and allow user to configure vscode-go to kill the previous run when starting the new one).Describe alternatives you've considered
Another alternative would be waiting for the previous run to complete. But if I just saved again is because most likely I noticed something wrong in the code, and therefore I probably don't care about the results of the previous run. Note that this applies even if multiple
go test
invocations actually were able to run concurrently without issue.Another option would be to never make mistakes. Sometimes I wish I could do that.
Additional context
The text was updated successfully, but these errors were encountered: