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

Function runRPCs

binarylog/binarylog_end2end_test.go:752–791  ·  view source on GitHub ↗
(t *testing.T, cc *rpcConfig)

Source from the content-addressed store, hash-verified

750}
751
752func runRPCs(t *testing.T, cc *rpcConfig) *expectedData {
753 te := newTest(t)
754 te.startServer()
755 defer te.ss.Stop()
756
757 expect := &expectedData{
758 te: te,
759 cc: cc,
760 }
761
762 switch cc.callType {
763 case unaryRPC:
764 expect.method = "/grpc.testing.TestService/UnaryCall"
765 req, resp, err := te.doUnaryCall(cc)
766 expect.requests = []proto.Message{req}
767 expect.responses = []proto.Message{resp}
768 expect.err = err
769 case clientStreamRPC:
770 expect.method = "/grpc.testing.TestService/StreamingInputCall"
771 reqs, resp, err := te.doClientStreamCall(cc)
772 expect.requests = reqs
773 expect.responses = []proto.Message{resp}
774 expect.err = err
775 case serverStreamRPC:
776 expect.method = "/grpc.testing.TestService/StreamingOutputCall"
777 req, resps, err := te.doServerStreamCall(cc)
778 expect.responses = resps
779 expect.requests = []proto.Message{req}
780 expect.err = err
781 case fullDuplexStreamRPC, cancelRPC:
782 expect.method = "/grpc.testing.TestService/FullDuplexCall"
783 expect.requests, expect.responses, expect.err = te.doFullDuplexCallRoundtrip(cc)
784 }
785 if cc.success != (expect.err == nil) {
786 t.Fatalf("cc.success: %v, got error: %v", cc.success, expect.err)
787 }
788 te.ss.S.GracefulStop() // Wait for the server to stop.
789
790 return expect
791}
792
793// equalLogEntry sorts the metadata entries by key (to compare metadata).
794//

Callers 3

testClientBinaryLogFunction · 0.85
testServerBinaryLogFunction · 0.85
runAndCheckStatsFunction · 0.85

Calls 9

newTestFunction · 0.70
StopMethod · 0.65
FatalfMethod · 0.65
GracefulStopMethod · 0.65
startServerMethod · 0.45
doUnaryCallMethod · 0.45
doClientStreamCallMethod · 0.45
doServerStreamCallMethod · 0.45

Tested by

no test coverage detected