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

testing: Avoid concurrent go test invocations when "Test on Save" is enabled #1089

Closed
CAFxX opened this issue Jan 8, 2021 · 1 comment
Closed

Comments

@CAFxX
Copy link

CAFxX commented Jan 8, 2021

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 new go 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 parallel go 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

@hyangah hyangah changed the title Avoid concurrent go test invocations when "Test on Save" is enabled testing: Avoid concurrent go test invocations when "Test on Save" is enabled Jan 12, 2021
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/291969 mentions this issue: package.json: add disableConcurrentTests setting

@hyangah hyangah added this to the v0.23.0 milestone Mar 2, 2021
@golang golang locked and limited conversation to collaborators Mar 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants