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

Function doServerSideFailedUnaryCall

test/channelz_test.go:823–841  ·  view source on GitHub ↗
(tc testgrpc.TestServiceClient, t *testing.T)

Source from the content-addressed store, hash-verified

821}
822
823func doServerSideFailedUnaryCall(tc testgrpc.TestServiceClient, t *testing.T) {
824 const smallSize = 1
825 const largeSize = 2000
826
827 largePayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, largeSize)
828 if err != nil {
829 t.Fatal(err)
830 }
831 req := &testpb.SimpleRequest{
832 ResponseType: testpb.PayloadType_COMPRESSABLE,
833 ResponseSize: int32(smallSize),
834 Payload: largePayload,
835 }
836 ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
837 defer cancel()
838 if _, err := tc.UnaryCall(ctx, req); err == nil || status.Code(err) != codes.ResourceExhausted {
839 t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted)
840 }
841}
842
843func doClientSideInitiatedFailedStream(tc testgrpc.TestServiceClient, t *testing.T) {
844 ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)

Calls 5

CodeFunction · 0.92
newPayloadFunction · 0.85
FatalMethod · 0.65
UnaryCallMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected