浏览代码

http2: fix expected message order in TestServerHandlerConnectionClose

There is no guaranteed ordering between writing headers and graceful
shutdown, both put a message on different channels.

Fixes golang/go#26190

Change-Id: I883fcf1de4bbe5a87af418d1b897a8aa941f1fd4
Reviewed-on: https://go-review.googlesource.com/122335
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Michael Fraenkel 7 年之前
父节点
当前提交
41b796e161
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      http2/server_test.go

+ 3 - 3
http2/server_test.go

@@ -3817,9 +3817,6 @@ func TestServerHandlerConnectionClose(t *testing.T) {
 				}
 			case *HeadersFrame:
 				goth := st.decodeHeader(f.HeaderBlockFragment())
-				if !sawGoAway {
-					t.Fatalf("unexpected Headers frame before GOAWAY: %s, %v", summarizeFrame(f), goth)
-				}
 				wanth := [][2]string{
 					{":status", "200"},
 					{"foo", "bar"},
@@ -3836,6 +3833,9 @@ func TestServerHandlerConnectionClose(t *testing.T) {
 				t.Logf("unexpected frame: %v", summarizeFrame(f))
 			}
 		}
+		if !sawGoAway {
+			t.Errorf("didn't see GOAWAY")
+		}
 		if !sawRes {
 			t.Errorf("didn't see response")
 		}