From 3ee391be2c149bf33ba4357cd9ece36d511b1042 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Fri, 22 Jan 2021 11:35:41 -0500 Subject: [PATCH] Any test that needs a VtctldServer needs to override the protocol to the fake Signed-off-by: Andrew Mason --- go/vt/vtadmin/api_test.go | 5 +++++ go/vt/vtctl/grpcvtctldserver/server_test.go | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/go/vt/vtadmin/api_test.go b/go/vt/vtadmin/api_test.go index fcd310b21b9..d2f7840d579 100644 --- a/go/vt/vtadmin/api_test.go +++ b/go/vt/vtadmin/api_test.go @@ -39,6 +39,7 @@ import ( "vitess.io/vitess/go/vt/vtctl/grpcvtctldserver" "vitess.io/vitess/go/vt/vtctl/grpcvtctldserver/testutil" "vitess.io/vitess/go/vt/vtctl/vtctldclient" + "vitess.io/vitess/go/vt/vttablet/tmclient" topodatapb "vitess.io/vitess/go/vt/proto/topodata" vtadminpb "vitess.io/vitess/go/vt/proto/vtadmin" @@ -46,6 +47,10 @@ import ( "vitess.io/vitess/go/vt/proto/vttime" ) +func init() { + *tmclient.TabletManagerProtocol = testutil.TabletManagerClientProtocol +} + func TestGetGates(t *testing.T) { fakedisco1 := fakediscovery.New() cluster1 := &cluster.Cluster{ diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index 3f7b724dd16..cdc6003e80c 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -39,6 +39,10 @@ import ( vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" ) +func init() { + *tmclient.TabletManagerProtocol = testutil.TabletManagerClientProtocol +} + func TestFindAllShardsInKeyspace(t *testing.T) { ctx := context.Background() ts := memorytopo.NewServer("cell1") @@ -264,7 +268,6 @@ func TestGetTablet(t *testing.T) { } func TestGetSchema(t *testing.T) { - *tmclient.TabletManagerProtocol = testutil.TabletManagerClientProtocol ctx := context.Background() ts := memorytopo.NewServer("zone1") vtctld := NewVtctldServer(ts)