in multiple packages: fixed goroutine leak bugs in tests (cont.d) (#11570)

This commit is contained in:
sfzhu93
2020-01-30 13:55:59 -05:00
committed by GitHub
parent cad92706cf
commit 467e08c32a
5 changed files with 10 additions and 10 deletions

View File

@@ -285,7 +285,7 @@ func TestSimpleHTTPClientDoHeaderTimeout(t *testing.T) {
tr.finishCancel <- struct{}{}
c := &simpleHTTPClient{transport: tr, headerTimeout: time.Millisecond}
errc := make(chan error)
errc := make(chan error, 1)
go func() {
_, _, err := c.Do(context.Background(), &fakeAction{})
errc <- err
@@ -452,7 +452,7 @@ func TestHTTPClusterClientDoDeadlineExceedContext(t *testing.T) {
endpoints: []url.URL{fakeURL},
}
errc := make(chan error)
errc := make(chan error, 1)
go func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
defer cancel()
@@ -502,7 +502,7 @@ func TestHTTPClusterClientDoCanceledContext(t *testing.T) {
endpoints: []url.URL{fakeURL},
}
errc := make(chan error)
errc := make(chan error, 1)
go func() {
ctx, cancel := withTimeout(fakeCancelContext{}, time.Millisecond)
cancel()