Sfoglia il codice sorgente

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 anni fa
parent
commit
41b796e161
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  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")
 		}