Skip to content

Commit 70fbc88

Browse files
AlexanderYastrebovneild
authored andcommitted
net/http: add ResponseController http2 request without body read deadline test
Requires CL 464936 For #58237 Change-Id: I007b61f0f216d759f8e5327d77affbd9e8f8ff23 GitHub-Last-Rev: 30a1090 GitHub-Pull-Request: #58282 Reviewed-on: https://go-review.googlesource.com/c/go/+/465035 Reviewed-by: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent 911b066 commit 70fbc88

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/net/http/responsecontroller_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,18 @@ func testResponseControllerEnableFullDuplex(t *testing.T, mode testMode) {
326326
}
327327
pw.Close()
328328
}
329+
330+
func TestIssue58237(t *testing.T) {
331+
cst := newClientServerTest(t, http2Mode, HandlerFunc(func(w ResponseWriter, req *Request) {
332+
ctl := NewResponseController(w)
333+
if err := ctl.SetReadDeadline(time.Now().Add(1 * time.Millisecond)); err != nil {
334+
t.Errorf("ctl.SetReadDeadline() = %v, want nil", err)
335+
}
336+
time.Sleep(10 * time.Millisecond)
337+
}))
338+
res, err := cst.c.Get(cst.ts.URL)
339+
if err != nil {
340+
t.Fatal(err)
341+
}
342+
res.Body.Close()
343+
}

0 commit comments

Comments
 (0)