-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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: document cap the number of concurrent goroutines with -race #23611
Comments
I'm curious as to whether and how this arose in reality. Do you have tests that intentionally use |
Yeah, so originally I had N tests each with M subtests, not too dissimilar from this example in the
Running the tests that way allowed them to complete in half the time (something like 1 instead of 2 minutes). After drastically increasing the number of (auto-generated) M, I started running into mysterious TravisCI errors which I then discovered was the 8192 goroutine limit. |
I don't think is possible. There is already a limit on the number of tests that are run in parallel, controlled by the I'm going to close this as impossible but I'd be willing to hear a proposal for how to implement it. |
@ianlancetaylor fair enough. Could this be a doc fix, though? It was confusing the first time I stumbled upon it. I mean, the |
I'm OK with a doc fix but I'm not sure where it should go. Maybe in https://blog.golang.org/race-detector ? |
Throwing a couple ideas out there:
|
I'm fine with a comment in |
@ianlancetaylor yessir. I'll get to it tonight. Do you want it inside |
I would guess below it, actually. |
Change https://golang.org/cl/103160 mentions this issue: |
@ianlancetaylor great that's where I added it. And darn, I should've tried making it with the new GitHub deal instead of |
What version of Go are you using (
go version
)?1.9.2
GOOS=linux
GOARCH=amd64
What did you do?
saved as
x_test.go
and run withgo test -race
What did you expect to see?
The tests to pass. Instead,
As I understand it, this is likely a technical limitation on Go's race detector. However, it would be nice for the
testing
package to be aware of this and, if raceenabled, cap the number of parallel tests at something below the 8192 limit (say, 7000?). Perhaps a better way would be a warning, but I know Go doesn't really like warnings.The text was updated successfully, but these errors were encountered: