Skip to content
Merged
Changes from 4 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
24816f2
add test with invalid client id
AnandInguva Jan 12, 2024
4300406
add test for invalid frame
AnandInguva Jan 24, 2024
71b7ee7
Check if the err is nil or not
AnandInguva Jan 24, 2024
9815dbc
Add comment for the test
AnandInguva Jan 24, 2024
3bd77df
Run the test against a single env
AnandInguva Jan 26, 2024
bee7003
Remove redundant comments
AnandInguva Jan 26, 2024
6b13297
Remove funcServer and try to assert the error
AnandInguva Feb 1, 2024
5fff887
Add test for illegal stream id on server operateHeader
AnandInguva Feb 1, 2024
ac91174
assert for io.EOF error
AnandInguva Feb 1, 2024
577a1b7
Address comments
AnandInguva Feb 6, 2024
f25503b
Fix assertion
AnandInguva Feb 6, 2024
c68ded3
Add back new line
AnandInguva Feb 6, 2024
3e863de
Send GoAwayFrame when illegal streamID is received
AnandInguva Feb 8, 2024
4338789
Remove comment
AnandInguva Feb 8, 2024
f1855d3
Merge remote-tracking branch 'upstream/master' into add_test
AnandInguva Feb 8, 2024
34dd481
Use servertester wantGoFrame for assertion
AnandInguva Feb 9, 2024
14ecbb8
Return error and add GoAwayFrame
AnandInguva Feb 9, 2024
cfa206b
Update test/end2end_test.go
AnandInguva Feb 9, 2024
4d3bc72
Add a comment on error case
AnandInguva Feb 9, 2024
26c215b
Refactor test
AnandInguva Feb 9, 2024
fcff403
Break comment
AnandInguva Feb 10, 2024
ad742c3
Add space
AnandInguva Feb 12, 2024
7a1a6f8
Modify assertion
AnandInguva Feb 12, 2024
7bbea1f
Fix condition
AnandInguva Feb 12, 2024
fa61215
Add test for stream ID lower than previous frame's streamID
AnandInguva Feb 16, 2024
6b79110
Fix test
AnandInguva Feb 16, 2024
a1d33da
rewrite error message
AnandInguva Feb 16, 2024
3522f84
Update error message
AnandInguva Feb 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions test/end2end_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3901,6 +3901,36 @@ func (s) TestClientRequestBodyErrorCloseAfterLength(t *testing.T) {
}
}

func testClientInvalidStreamID(t *testing.T, e env) {
te := newTest(t, e)
ts := &funcServer{streamingInputCall: func(stream testgrpc.TestService_StreamingInputCallServer) error {
_, err := stream.Recv()
return err
}}
te.startServer(ts)
defer te.tearDown()
te.withServerTester(func(st *serverTester) {
st.writeHeadersGRPC(2, "/grpc.testing.TestService/StreamingInputCall", true)
_, err := st.fr.ReadFrame()
if err == nil {
t.Fatalf("Error expected when Client StreamID is even %v", err)
}
})
}

// Client must always send a streamID in odd numbers according to
// https://httpwg.org/specs/rfc7540.html#StreamIdentifiers. This test
// makes sure that the transport throws an error when the client streamID is
// even.
func (s) TestClientInvalidStreamID(t *testing.T) {
for _, e := range listTestEnv() {
if e.httpHandler {
continue
}
testClientInvalidStreamID(t, e)
}
}

func testClientRequestBodyErrorCloseAfterLength(t *testing.T, e env) {
te := newTest(t, e)
te.declareLogNoise("Server.processUnaryRPC failed to write status")
Expand Down