mirror of
https://github.com/golang/go
synced 2024-11-26 00:57:56 -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:
parent
911b066bf8
commit
70fbc88288
@ -326,3 +326,18 @@ func testResponseControllerEnableFullDuplex(t *testing.T, mode testMode) {
|
|||||||
}
|
}
|
||||||
pw.Close()
|
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()
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user