]> Cypherpunks repositories - gostls13.git/commit
net: avoid race on test hooks with DNS goroutines
authorIan Lance Taylor <iant@golang.org>
Fri, 8 Dec 2017 04:30:28 +0000 (20:30 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 8 Dec 2017 05:12:13 +0000 (05:12 +0000)
commit6c877e5da7ab14f0d8a206c09f24cf51fbbc393a
tree2d4ed0c24d5e0b343a885835c9c0f0e75bbb9d1e
parent6af8c0d812f7bd20d81df986c3ed425f3251e8dc
net: avoid race on test hooks with DNS goroutines

The DNS code can start goroutines and not wait for them to complete.
This does no harm, but in tests this can cause a race condition with
the test hooks that are installed and unintalled around the tests.
Add a WaitGroup that tests of DNS can use to avoid the race.

Fixes #21090

Change-Id: I6c1443a9c2378e8b89d0ab1d6390c0e3e726b0ce
Reviewed-on: https://go-review.googlesource.com/82795
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/internal/singleflight/singleflight.go
src/net/cgo_unix_test.go
src/net/dnsclient_unix.go
src/net/dnsclient_unix_test.go
src/net/lookup.go
src/net/lookup_test.go
src/net/netgo_unix_test.go