net/http: add ResponseController http2 request without body read deadline test

Requires CL 464936

For #58237
This commit is contained in:
Alexander Yastrebov 2023-02-02 23:04:55 +01:00
parent 5abae02d27
commit 30a10909b0
1 changed files with 15 additions and 0 deletions

View File

@ -326,3 +326,18 @@ func testResponseControllerEnableFullDuplex(t *testing.T, mode testMode) {
}
pw.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)
}
res.Body.Close()
}