Skip to content

Commit

Permalink
hack: change internal package name for grpc.reflection.v1 to prevent …
Browse files Browse the repository at this point in the history
…possible init crash (#555)
  • Loading branch information
jhump authored Mar 3, 2023
1 parent 7923b75 commit 81aa758
Show file tree
Hide file tree
Showing 6 changed files with 240 additions and 194 deletions.
9 changes: 7 additions & 2 deletions grpcreflect/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,11 @@ func TestAutoVersion(t *testing.T) {
testClientAuto(t,
func(s *grpc.Server) {
grpc_reflection_v1.Register(s)
// HACK: The above won't show up in list of service names, so we need at least one other.
testprotosgrpc.RegisterDummyServiceServer(s, testService{})
},
[]string{
"grpc.reflection.v1.ServerReflection",
"testprotos.DummyService",
},
[]string{
"/grpc.reflection.v1.ServerReflection/ServerReflectionInfo",
Expand All @@ -392,9 +394,11 @@ func TestAutoVersion(t *testing.T) {
testClientAuto(t,
func(s *grpc.Server) {
reflection.Register(s)
testprotosgrpc.RegisterDummyServiceServer(s, testService{})
},
[]string{
"grpc.reflection.v1alpha.ServerReflection",
"testprotos.DummyService",
},
[]string{
// first one fails, so falls back to v1alpha
Expand All @@ -414,10 +418,11 @@ func TestAutoVersion(t *testing.T) {
func(s *grpc.Server) {
grpc_reflection_v1.Register(s)
reflection.Register(s)
testprotosgrpc.RegisterDummyServiceServer(s, testService{})
},
[]string{
"grpc.reflection.v1.ServerReflection",
"grpc.reflection.v1alpha.ServerReflection",
"testprotos.DummyService",
},
[]string{
// never uses v1alpha since v1 works
Expand Down
Loading

0 comments on commit 81aa758

Please sign in to comment.