mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

Go 1.4 landed a new testing.M type [1][1] which allows for start-up and shutdown hooks when running tests. The standard library now uses this for checking for leaked goroutines in net/http [2][2]. This patch essentially re-ports the updated code from the net/http test (we were using an older version of it) - in detail: - updates the test to use `TestMain` instead of relying on `TestGoroutinesRunning` to be implicitly run after all other tests - adds a few new goroutines to the list of exceptions (the test itself, as well as the golang/glog package and pkg/log.MergeLogger, both of which spin off goroutines to handle log flushing/merging respectively) - removes a couple of TODOs in the test for extra goroutines that's run after individual tests (one of these re-enables the http package's `.readLoop` and the other was an out-of-date TODO) - re-enables the test [1]: https://golang.org/pkg/testing/#M [2]: https://github.com/golang/go/blob/release-branch.go1.4/src/net/http/main_test.go#L18