-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
What version of Go are you using (go version
)?
1.9.2
GOOS=linux
GOARCH=amd64
What did you do?
package main
import (
"math/rand"
"strconv"
"testing"
"time"
)
func TestGoRoutines(t *testing.T) {
for i := 0; i < 1<<15; i++ {
t.Run(strconv.Itoa(i), func(t *testing.T) {
t.Parallel()
time.Sleep(time.Duration(rand.Intn(500000000)))
})
}
}
saved as x_test.go
and run with go test -race
What did you expect to see?
The tests to pass. Instead,
race: limit on 8192 simultaneously alive goroutines is exceeded, dying
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.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.