MCPcopy
hub / github.com/grpc/grpc-go / testClientMaxHeaderListSizeServerUserViolation

Function testClientMaxHeaderListSizeServerUserViolation

test/end2end_test.go:6045–6065  ·  view source on GitHub ↗
(t *testing.T, e env)

Source from the content-addressed store, hash-verified

6043}
6044
6045func testClientMaxHeaderListSizeServerUserViolation(t *testing.T, e env) {
6046 te := newTest(t, e)
6047 te.maxClientHeaderListSize = new(uint32)
6048 *te.maxClientHeaderListSize = 1 // any header server sends will violate
6049 te.startServer(&testServer{security: e.security})
6050 defer te.tearDown()
6051
6052 cc := te.clientConn()
6053 tc := testgrpc.NewTestServiceClient(cc)
6054 ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
6055 defer cancel()
6056 var err error
6057 if err = verifyResultWithDelay(func() (bool, error) {
6058 if _, err = tc.EmptyCall(ctx, &testpb.Empty{}); err != nil && status.Code(err) == codes.Internal {
6059 return true, nil
6060 }
6061 return false, fmt.Errorf("tc.EmptyCall() = _, err: %v, want _, error code: %v", err, codes.Internal)
6062 }); err != nil {
6063 t.Fatal(err)
6064 }
6065}
6066
6067func (s) TestServerMaxHeaderListSizeClientIntentionalViolation(t *testing.T) {
6068 for _, e := range listTestEnv() {

Calls 9

EmptyCallMethod · 0.95
CodeMethod · 0.80
newTestFunction · 0.70
verifyResultWithDelayFunction · 0.70
ErrorfMethod · 0.65
FatalMethod · 0.65
startServerMethod · 0.45
tearDownMethod · 0.45
clientConnMethod · 0.45

Tested by

no test coverage detected