http2: read request in TestTransportBodyLargerThanXXX

Otherwise the server can stop the connection before
clientStream.writeRequestBody has a chance to see if there is any more
data beyond the specified content length.

Tested by adding time.Sleep(time.Millisecond) to chunkReader.Read,
which caused the test to reliably fail before this change,
and reliably pass afterward.

Fixes golang/go#34616

Change-Id: I119bdf01bf916b2ded2c5d293655cba2596c0166
Reviewed-on: https://go-review.googlesource.com/c/net/+/234523
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/http2/transport_test.go b/http2/transport_test.go
index 7fe1d16..a17aa4a 100644
--- a/http2/transport_test.go
+++ b/http2/transport_test.go
@@ -4516,7 +4516,7 @@
 
 func testTransportBodyLargerThanSpecifiedContentLength(t *testing.T, body *chunkReader, contentLen int64) {
 	st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {
-		// Nothing.
+		r.Body.Read(make([]byte, 6))
 	}, optOnlyServer)
 	defer st.Close()