Skip to content

Commit 7a1a6f8

Browse files
committed
Modify assertion
1 parent ad742c3 commit 7a1a6f8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/end2end_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3903,9 +3903,9 @@ func (s) TestClientRequestBodyErrorCloseAfterLength(t *testing.T) {
39033903

39043904
// Tests gRPC server's behavior when a gRPC client sends a frame with an invalid
39053905
// streamID. Per [HTTP/2 spec]: Streams initiated by a client MUST use
3906-
// odd-numbered stream identifiers. This test sets up a test server and send a
3906+
// odd-numbered stream identifiers. This test sets up a test server and sends a
39073907
// header frame with stream ID of 2. The test asserts that a subsequent read on
3908-
// the transport throws an error.
3908+
// the transport sends a GoAwayFrame with error code: PROTOCOL_ERROR.
39093909
//
39103910
// [HTTP/2 spec]: https://httpwg.org/specs/rfc7540.html#StreamIdentifiers
39113911
func (s) TestClientInvalidStreamID(t *testing.T) {
@@ -3926,8 +3926,8 @@ func (s) TestClientInvalidStreamID(t *testing.T) {
39263926
st.greet()
39273927
st.writeHeadersGRPC(2, "/grpc.testing.TestService/StreamingInputCall", true)
39283928
goAwayFrame := st.wantGoAway(http2.ErrCodeProtocol)
3929-
want := "received an illegal stream id: 2. headers frame: [FrameHeader HEADERS flags=END_STREAM|END_HEADERS stream=2 len=60]"
3930-
if got := string(goAwayFrame.DebugData()); got != want {
3929+
want := "received an illegal stream id: 2."
3930+
if got := string(goAwayFrame.DebugData()); strings.Contains(got, want) {
39313931
t.Fatalf("Error received: %v, want: %v", got, want)
39323932
}
39333933
}

0 commit comments

Comments
 (0)