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: not clear whether parallel tests can run in parallel with themselves #18914

Closed
mvdan opened this issue Feb 3, 2017 · 1 comment
Closed

Comments

@mvdan
Copy link
Member

mvdan commented Feb 3, 2017

https://golang.org/pkg/testing/#T.Parallel says:

Parallel signals that this test is to be run in parallel with (and only with) other parallel tests.

Is the test itself included in other parallel tests? You could understand that other means it's not included, but the wording isn't clear to me or a couple of people I've asked.

This is important because people (including myself) often write parallel tests in a way that they don't break other parallel tests, but not themselves. For example, it might use t.Name() as a unique identifier/key in a database.

I ran some quick tests and it does seem like a parallel test never runs in parallel with itself. Will post a doc CL soon.

@gopherbot
Copy link

CL https://golang.org/cl/36272 mentions this issue.

@golang golang locked and limited conversation to collaborators Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants