Commit 4280ed84 authored by Burcu Dogan's avatar Burcu Dogan

net/http: skip TestClientTimeout_Headers in HTTP/2 mode

Change-Id: I3533b557cd6c7127ab4efbe8766184b51ce260c9
Reviewed-on: https://go-review.googlesource.com/17768Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent 9025408a
...@@ -1000,17 +1000,23 @@ func testClientTimeout(t *testing.T, h2 bool) { ...@@ -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 // 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() { if testing.Short() {
t.Skip("skipping in short mode") t.Skip("skipping in short mode")
} }
defer afterTest(t) defer afterTest(t)
donec := make(chan bool) donec := make(chan bool)
ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) { cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) {
<-donec <-donec
})) }))
defer ts.Close() defer cst.close()
// Note that we use a channel send here and not a 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 // 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 // and thinks that the waitgroup inside httptest.Server is added to concurrently
...@@ -1020,9 +1026,8 @@ func TestClientTimeout_Headers(t *testing.T) { ...@@ -1020,9 +1026,8 @@ func TestClientTimeout_Headers(t *testing.T) {
// doesn't know this, so synchronize explicitly. // doesn't know this, so synchronize explicitly.
defer func() { donec <- true }() defer func() { donec <- true }()
c := &Client{Timeout: 500 * time.Millisecond} cst.c.Timeout = 500 * time.Millisecond
_, err := cst.c.Get(cst.ts.URL)
_, err := c.Get(ts.URL)
if err == nil { if err == nil {
t.Fatal("got response from Get; expected error") t.Fatal("got response from Get; expected error")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment