The Go Race Detector has a goroutine limit of 8192 (at least on my system). One test I run is to see how my server code handles a large number of simultaneous open connections (right now I'm trying out > 15000). When I run go test --race
, therefore, that particular test fails. I'd rather it be skipped when run using -race
instead of failing directly. How can I do that?
The build tag race
is defined when building with the -race flag.
Move the tests you want to exclude to a file with the build constraint comment:
// +build !race