mirror of https://github.com/grpc/grpc-go.git
fix minor typos and remove grpc.Codec related code in TestInterceptorCanAccessCallOptions (#1929)
This commit is contained in:
parent
211a7b7ec0
commit
738eb6b62f
|
|
@ -291,7 +291,7 @@ func PerRPCCredentials(creds credentials.PerRPCCredentials) CallOption {
|
||||||
return PerRPCCredsCallOption{Creds: creds}
|
return PerRPCCredsCallOption{Creds: creds}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PerRPCCredsCallOption is a CallOption that indicates the the per-RPC
|
// PerRPCCredsCallOption is a CallOption that indicates the per-RPC
|
||||||
// credentials to use for the call.
|
// credentials to use for the call.
|
||||||
// This is an EXPERIMENTAL API.
|
// This is an EXPERIMENTAL API.
|
||||||
type PerRPCCredsCallOption struct {
|
type PerRPCCredsCallOption struct {
|
||||||
|
|
|
||||||
|
|
@ -1244,7 +1244,7 @@ func testFailFast(t *testing.T, e env) {
|
||||||
if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil {
|
if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil {
|
||||||
t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
|
t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
|
||||||
}
|
}
|
||||||
// Stop the server and tear down all the exisiting connections.
|
// Stop the server and tear down all the existing connections.
|
||||||
te.srv.Stop()
|
te.srv.Stop()
|
||||||
// Loop until the server teardown is propagated to the client.
|
// Loop until the server teardown is propagated to the client.
|
||||||
for {
|
for {
|
||||||
|
|
@ -5901,7 +5901,6 @@ func TestInterceptorCanAccessCallOptions(t *testing.T) {
|
||||||
maxSendSize []int
|
maxSendSize []int
|
||||||
compressor []string
|
compressor []string
|
||||||
subtype []string
|
subtype []string
|
||||||
codec []grpc.Codec
|
|
||||||
}
|
}
|
||||||
var observedOpts observedOptions
|
var observedOpts observedOptions
|
||||||
populateOpts := func(opts []grpc.CallOption) {
|
populateOpts := func(opts []grpc.CallOption) {
|
||||||
|
|
@ -5925,8 +5924,6 @@ func TestInterceptorCanAccessCallOptions(t *testing.T) {
|
||||||
observedOpts.compressor = append(observedOpts.compressor, o.CompressorType)
|
observedOpts.compressor = append(observedOpts.compressor, o.CompressorType)
|
||||||
case grpc.ContentSubtypeCallOption:
|
case grpc.ContentSubtypeCallOption:
|
||||||
observedOpts.subtype = append(observedOpts.subtype, o.ContentSubtype)
|
observedOpts.subtype = append(observedOpts.subtype, o.ContentSubtype)
|
||||||
case grpc.CustomCodecCallOption:
|
|
||||||
observedOpts.codec = append(observedOpts.codec, o.Codec)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5972,20 +5969,17 @@ func TestInterceptorCanAccessCallOptions(t *testing.T) {
|
||||||
|
|
||||||
observedOpts = observedOptions{} // reset
|
observedOpts = observedOptions{} // reset
|
||||||
|
|
||||||
var codec errCodec
|
|
||||||
tc.StreamingInputCall(context.Background(),
|
tc.StreamingInputCall(context.Background(),
|
||||||
grpc.FailFast(true),
|
grpc.FailFast(true),
|
||||||
grpc.MaxCallSendMsgSize(2020),
|
grpc.MaxCallSendMsgSize(2020),
|
||||||
grpc.UseCompressor("comp-type"),
|
grpc.UseCompressor("comp-type"),
|
||||||
grpc.CallContentSubtype("json"),
|
grpc.CallContentSubtype("json"))
|
||||||
grpc.CallCustomCodec(&codec))
|
|
||||||
expected = observedOptions{
|
expected = observedOptions{
|
||||||
failFast: []bool{false, true},
|
failFast: []bool{false, true},
|
||||||
maxRecvSize: []int{1010},
|
maxRecvSize: []int{1010},
|
||||||
maxSendSize: []int{2020},
|
maxSendSize: []int{2020},
|
||||||
compressor: []string{"comp-type"},
|
compressor: []string{"comp-type"},
|
||||||
subtype: []string{"json"},
|
subtype: []string{"json"},
|
||||||
codec: []grpc.Codec{&codec},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !reflect.DeepEqual(expected, observedOpts) {
|
if !reflect.DeepEqual(expected, observedOpts) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue