1
0
mirror of https://github.com/golang/go synced 2024-11-26 00:17:58 -07:00

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

Requires CL 464936

For #58237

Change-Id: I007b61f0f216d759f8e5327d77affbd9e8f8ff23
GitHub-Last-Rev: 30a10909b0
GitHub-Pull-Request: golang/go#58282
Reviewed-on: https://go-review.googlesource.com/c/go/+/465035
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Alexander Yastrebov 2023-11-22 09:21:27 +00:00 committed by Damien Neil
parent 911b066bf8
commit 70fbc88288

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()
}