[internal-branch.go1.22-vendor] http2: fix TestServerContinuationFlood flakes

This test causes the server to send a GOAWAY and close a connection.
The server GOAWAY path writes a GOAWAY frame asynchronously, and
closes the connection if the write doesn't complete within 1s.
This is causing failures on some builders, when the frame write
doesn't complete in time.

The important aspect of this test is that the connection be closed.
Drop the check for the GOAWAY frame.

This is a test-only fix that has no effect on the vendored content,
helps tests on this branch, and avoids a merge conflict in next CL.

For golang/go#66698.

Change-Id: I099413be9c4dfe71d8fe83d2c6242e82e282293e
Reviewed-on: https://go-review.googlesource.com/c/net/+/576235
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/net/+/578337
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
diff --git a/http2/server_test.go b/http2/server_test.go
index 8b61d7b..4ab1228 100644
--- a/http2/server_test.go
+++ b/http2/server_test.go
@@ -4804,22 +4804,24 @@
 		"x-last-header", "1",
 	))
 
-	var sawGoAway bool
 	for {
 		f, err := st.readFrame()
 		if err != nil {
 			break
 		}
 		switch f.(type) {
-		case *GoAwayFrame:
-			sawGoAway = true
 		case *HeadersFrame:
-			t.Fatalf("received HEADERS frame; want GOAWAY")
+			t.Fatalf("received HEADERS frame; want GOAWAY and a closed connection")
 		}
 	}
-	if !sawGoAway {
-		t.Errorf("connection closed with no GOAWAY frame; want one")
-	}
+	// We expect to have seen a GOAWAY before the connection closes,
+	// but the server will close the connection after one second
+	// whether or not it has finished sending the GOAWAY. On windows-amd64-race
+	// builders, this fairly consistently results in the connection closing without
+	// the GOAWAY being sent.
+	//
+	// Since the server's behavior is inherently racy here and the important thing
+	// is that the connection is closed, don't check for the GOAWAY having been sent.
 }
 
 func TestServerContinuationAfterInvalidHeader(t *testing.T) {