Skip to content

Commit

Permalink
net/http: add ResponseController http2 request without body read dead…
Browse files Browse the repository at this point in the history
…line test

Requires CL 464936

For golang#58237
  • Loading branch information
AlexanderYastrebov committed Feb 2, 2023
1 parent 88a36c9 commit e950604
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/net/http/responsecontroller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,18 @@ func testWrappedResponseController(t *testing.T, mode testMode) {
io.Copy(io.Discard, res.Body)
defer res.Body.Close()
}

func TestIssue58237(t *testing.T) {
cst := newClientServerTest(t, http2Mode, HandlerFunc(func(w ResponseWriter, req *Request) {
ctl := NewResponseController(w)
if err := ctl.SetReadDeadline(time.Now().Add(1 * time.Millisecond)); err != nil {
t.Errorf("ctl.SetReadDeadline() = %v, want nil", err)
}
time.Sleep(10 * time.Millisecond)
}))
res, err := cst.c.Get(cst.ts.URL)
if err != nil {
t.Fatal(err)
}
defer res.Body.Close()
}

0 comments on commit e950604

Please sign in to comment.