瀏覽代碼

http2: fix race in flaky TestServer_Rejects_TooSmall

There is a race between scheduling the response of the header frame and
when the data frame error is detected. The header frame may be
queued before or after the stream reset.

Fixes golang/go#25645

Change-Id: Id598eedfec9538fb7b154102a1a6e28e08fe117f
Reviewed-on: https://go-review.googlesource.com/121197
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Michael Fraenkel 7 年之前
父節點
當前提交
e514e69ffb
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      http2/server_test.go

+ 1 - 0
http2/server_test.go

@@ -3762,6 +3762,7 @@ func TestIssue20704Race(t *testing.T) {
 
 func TestServer_Rejects_TooSmall(t *testing.T) {
 	testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {
+		ioutil.ReadAll(r.Body)
 		return nil
 	}, func(st *serverTester) {
 		st.writeHeaders(HeadersFrameParam{