diff options
| author | Burcu Dogan <jbd@google.com> | 2015-12-14 16:39:09 -0800 |
|---|---|---|
| committer | Burcu Dogan <jbd@google.com> | 2015-12-15 01:46:34 +0000 |
| commit | 4280ed84fd7a8de329074f57bbfb3af6fc7f93d5 (patch) | |
| tree | a64a6f6feabae5a20368b370c7ba50f0affeed05 /src/net/http/client_test.go | |
| parent | 9025408ab5576af13a4ef2e395426053b9c7b28e (diff) | |
| download | go-4280ed84fd7a8de329074f57bbfb3af6fc7f93d5.tar.xz | |
net/http: skip TestClientTimeout_Headers in HTTP/2 mode
Change-Id: I3533b557cd6c7127ab4efbe8766184b51ce260c9
Reviewed-on: https://go-review.googlesource.com/17768
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net/http/client_test.go')
| -rw-r--r-- | src/net/http/client_test.go | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/net/http/client_test.go b/src/net/http/client_test.go index 163534df38..3aa5b5d3ef 100644 --- a/src/net/http/client_test.go +++ b/src/net/http/client_test.go @@ -1000,17 +1000,23 @@ func testClientTimeout(t *testing.T, h2 bool) { } } +func TestClientTimeout_Headers_h1(t *testing.T) { testClientTimeout_Headers(t, h1Mode) } +func TestClientTimeout_Headers_h2(t *testing.T) { + t.Skip("skipping in http2 mode; golang.org/issue/13540") + testClientTimeout_Headers(t, h2Mode) +} + // Client.Timeout firing before getting to the body -func TestClientTimeout_Headers(t *testing.T) { +func testClientTimeout_Headers(t *testing.T, h2 bool) { if testing.Short() { t.Skip("skipping in short mode") } defer afterTest(t) donec := make(chan bool) - ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) { + cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) { <-donec })) - defer ts.Close() + 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 // and thinks that the waitgroup inside httptest.Server is added to concurrently @@ -1020,9 +1026,8 @@ func TestClientTimeout_Headers(t *testing.T) { // doesn't know this, so synchronize explicitly. defer func() { donec <- true }() - c := &Client{Timeout: 500 * time.Millisecond} - - _, err := c.Get(ts.URL) + cst.c.Timeout = 500 * time.Millisecond + _, err := cst.c.Get(cst.ts.URL) if err == nil { t.Fatal("got response from Get; expected error") } |
