diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2019-05-28 17:45:22 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2019-05-28 18:17:57 +0000 |
| commit | 770746af1cf7900cb770767584abd3251013d932 (patch) | |
| tree | d630d606a0f5fd509fb0a5f308f9f649394912ef | |
| parent | ddb5d0db37b885ba327180816253714625fd3c38 (diff) | |
| download | go-git-770746af1cf7900cb770767584abd3251013d932.tar.gz | |
net/http: quiet some log spam in tests
One of these tests creates a bunch of connections concurrently, then
discovers it doesn't need them all, which then makes the server log
that the client went away midway through the TLS handshake. Perhaps
the server should recognize that as a case not worthy of logging
about, but this is a safer way to eliminate the stderr spam during go
test for now.
The other test's client gives up on its connection and closes it,
similarly confusing the server.
Change-Id: I49ce442c9a63fc437e58ca79f044aa76e8c317b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/179179
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
| -rw-r--r-- | src/net/http/client_test.go | 2 | ||||
| -rw-r--r-- | src/net/http/serve_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/net/http/client_test.go b/src/net/http/client_test.go index 2f031e2f9b..de490bc607 100644 --- a/src/net/http/client_test.go +++ b/src/net/http/client_test.go @@ -1292,7 +1292,7 @@ func testClientTimeout_Headers(t *testing.T, h2 bool) { donec := make(chan bool, 1) cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) { <-donec - })) + }), optQuietLog) defer cst.close() // Note that we use a channel send here and not a close. // The race detector doesn't know that we're waiting for a timeout diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index d774915719..1c67b40161 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -4282,7 +4282,7 @@ func testServerEmptyBodyRace(t *testing.T, h2 bool) { var n int32 cst := newClientServerTest(t, h2, HandlerFunc(func(rw ResponseWriter, req *Request) { atomic.AddInt32(&n, 1) - })) + }), optQuietLog) defer cst.close() var wg sync.WaitGroup const reqs = 20 |
