Commit 910a6faa authored by Mikio Hara's avatar Mikio Hara

net: fix race in TestDNSThreadLimit

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13141045
parent ec9e3e62
......@@ -62,10 +62,10 @@ func TestDNSThreadLimit(t *testing.T) {
const N = 10000
c := make(chan int, N)
for i := 0; i < N; i++ {
go func() {
go func(i int) {
LookupIP(fmt.Sprintf("%d.net-test.golang.org", i))
c <- 1
}()
}(i)
}
// Don't bother waiting for the stragglers; stop at 0.9 N.
for i := 0; i < N*9/10; i++ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment