@@ -76,7 +76,6 @@ import (
76
76
"github.com/cockroachdb/logtags"
77
77
"github.com/cockroachdb/redact"
78
78
"github.com/gogo/protobuf/proto"
79
- "google.golang.org/grpc"
80
79
)
81
80
82
81
// makeTestConfig returns a config for testing. It overrides the
@@ -2621,7 +2620,7 @@ func (ts *testServer) NewClientRPCContext(
2621
2620
// RPCClientConn is part of the serverutils.ApplicationLayerInterface.
2622
2621
func (ts * testServer ) RPCClientConn (
2623
2622
test serverutils.TestFataler , user username.SQLUsername ,
2624
- ) * grpc. ClientConn {
2623
+ ) serverutils. RPCConn {
2625
2624
conn , err := ts .RPCClientConnE (user )
2626
2625
if err != nil {
2627
2626
test .Fatal (err )
@@ -2630,22 +2629,26 @@ func (ts *testServer) RPCClientConn(
2630
2629
}
2631
2630
2632
2631
// RPCClientConnE is part of the serverutils.ApplicationLayerInterface.
2633
- func (ts * testServer ) RPCClientConnE (user username.SQLUsername ) (* grpc. ClientConn , error ) {
2632
+ func (ts * testServer ) RPCClientConnE (user username.SQLUsername ) (serverutils. RPCConn , error ) {
2634
2633
ctx := context .Background ()
2635
2634
rpcCtx := ts .NewClientRPCContext (ctx , user )
2636
- return rpcCtx .GRPCDialNode (ts .AdvRPCAddr (), ts .NodeID (), ts .Locality (), rpcbase .DefaultClass ).Connect (ctx )
2635
+ conn , err := rpcCtx .GRPCDialNode (ts .AdvRPCAddr (), ts .NodeID (), ts .Locality (), rpcbase .DefaultClass ).Connect (ctx )
2636
+ if err != nil {
2637
+ return nil , err
2638
+ }
2639
+ return serverutils .FromGRPCConn (conn ), nil
2637
2640
}
2638
2641
2639
2642
// GetAdminClient is part of the serverutils.ApplicationLayerInterface.
2640
2643
func (ts * testServer ) GetAdminClient (test serverutils.TestFataler ) serverpb.AdminClient {
2641
2644
conn := ts .RPCClientConn (test , username .RootUserName ())
2642
- return serverpb .NewAdminClient (conn )
2645
+ return conn .NewAdminClient ()
2643
2646
}
2644
2647
2645
2648
// GetStatusClient is part of the serverutils.ApplicationLayerInterface.
2646
2649
func (ts * testServer ) GetStatusClient (test serverutils.TestFataler ) serverpb.StatusClient {
2647
2650
conn := ts .RPCClientConn (test , username .RootUserName ())
2648
- return serverpb .NewStatusClient (conn )
2651
+ return conn .NewStatusClient ()
2649
2652
}
2650
2653
2651
2654
// NewClientRPCContext is part of the serverutils.ApplicationLayerInterface.
@@ -2662,7 +2665,7 @@ func (t *testTenant) NewClientRPCContext(
2662
2665
// RPCClientConn is part of the serverutils.ApplicationLayerInterface.
2663
2666
func (t * testTenant ) RPCClientConn (
2664
2667
test serverutils.TestFataler , user username.SQLUsername ,
2665
- ) * grpc. ClientConn {
2668
+ ) serverutils. RPCConn {
2666
2669
conn , err := t .RPCClientConnE (user )
2667
2670
if err != nil {
2668
2671
test .Fatal (err )
@@ -2671,22 +2674,29 @@ func (t *testTenant) RPCClientConn(
2671
2674
}
2672
2675
2673
2676
// RPCClientConnE is part of the serverutils.ApplicationLayerInterface.
2674
- func (t * testTenant ) RPCClientConnE (user username.SQLUsername ) (* grpc. ClientConn , error ) {
2677
+ func (t * testTenant ) RPCClientConnE (user username.SQLUsername ) (serverutils. RPCConn , error ) {
2675
2678
ctx := context .Background ()
2676
2679
rpcCtx := t .NewClientRPCContext (ctx , user )
2677
- return rpcCtx .GRPCDialPod (t .AdvRPCAddr (), t .SQLInstanceID (), t .Locality (), rpcbase .DefaultClass ).Connect (ctx )
2680
+ if ! rpcbase .TODODRPC {
2681
+ conn , err := rpcCtx .GRPCDialPod (t .AdvRPCAddr (), t .SQLInstanceID (), t .Locality (), rpcbase .DefaultClass ).Connect (ctx )
2682
+ if err != nil {
2683
+ return nil , err
2684
+ }
2685
+ return serverutils .FromGRPCConn (conn ), nil
2686
+ }
2687
+ return nil , nil
2678
2688
}
2679
2689
2680
2690
// GetAdminClient is part of the serverutils.ApplicationLayerInterface.
2681
2691
func (t * testTenant ) GetAdminClient (test serverutils.TestFataler ) serverpb.AdminClient {
2682
2692
conn := t .RPCClientConn (test , username .RootUserName ())
2683
- return serverpb .NewAdminClient (conn )
2693
+ return conn .NewAdminClient ()
2684
2694
}
2685
2695
2686
2696
// GetStatusClient is part of the serverutils.ApplicationLayerInterface.
2687
2697
func (t * testTenant ) GetStatusClient (test serverutils.TestFataler ) serverpb.StatusClient {
2688
2698
conn := t .RPCClientConn (test , username .RootUserName ())
2689
- return serverpb .NewStatusClient (conn )
2699
+ return conn .NewStatusClient ()
2690
2700
}
2691
2701
2692
2702
func newClientRPCContext (
0 commit comments