From 6e4a4b0b3b857fcac3fc86418eebe5a655465eca Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 2 Jan 2025 16:33:32 -0500 Subject: [PATCH] Fix tabletmanager tests Signed-off-by: Matt Lord --- go/cmd/vtctldclient/command/topology.go | 4 ++-- go/test/endtoend/cluster/vtctldclient_process.go | 2 +- go/test/endtoend/tabletmanager/custom_rule_topo_test.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go/cmd/vtctldclient/command/topology.go b/go/cmd/vtctldclient/command/topology.go index a157b2a6c26..834976ad7fb 100644 --- a/go/cmd/vtctldclient/command/topology.go +++ b/go/cmd/vtctldclient/command/topology.go @@ -102,8 +102,8 @@ var writeTopologyPathOptions = struct { }{} func commandWriteTopologyPath(cmd *cobra.Command, args []string) error { - path := cmd.Flags().Arg(0) - file := cmd.Flags().Arg(1) + file := cmd.Flags().Arg(0) + path := cmd.Flags().Arg(1) ts, err := topo.OpenServer(topoOptions.implementation, strings.Join(topoOptions.globalServerAddresses, ","), topoOptions.globalRoot) if err != nil { return fmt.Errorf("failed to connect to the topology server: %v", err) diff --git a/go/test/endtoend/cluster/vtctldclient_process.go b/go/test/endtoend/cluster/vtctldclient_process.go index d32af8fa1be..9b76145c45d 100644 --- a/go/test/endtoend/cluster/vtctldclient_process.go +++ b/go/test/endtoend/cluster/vtctldclient_process.go @@ -90,7 +90,7 @@ func (vtctldclient *VtctldClientProcess) ExecuteCommandWithOutput(args ...string } if !slices.Contains(args, "--server") { // Only add the default server if one was not already specified. - args = append(args, "--server", vtctldclient.Server) + pArgs = append(pArgs, "--server", vtctldclient.Server) } if *isCoverage { pArgs = append(pArgs, "--test.coverprofile="+getCoveragePath("vtctldclient-"+args[0]+".out"), "--test.v") diff --git a/go/test/endtoend/tabletmanager/custom_rule_topo_test.go b/go/test/endtoend/tabletmanager/custom_rule_topo_test.go index 20e589edae4..c393e7c4646 100644 --- a/go/test/endtoend/tabletmanager/custom_rule_topo_test.go +++ b/go/test/endtoend/tabletmanager/custom_rule_topo_test.go @@ -54,7 +54,7 @@ func TestTopoCustomRule(t *testing.T) { require.NoError(t, err) // Copy config file into topo. - err = clusterInstance.VtctldClientProcess.ExecuteCommand("WriteTopologyPath", topoCustomRuleFile, topoCustomRulePath) + err = clusterInstance.VtctldClientProcess.ExecuteCommand("--server", "internal", "WriteTopologyPath", topoCustomRuleFile, topoCustomRulePath) require.Nil(t, err, "error should be Nil") // Set extra tablet args for topo custom rule @@ -100,7 +100,7 @@ func TestTopoCustomRule(t *testing.T) { err = os.WriteFile(topoCustomRuleFile, data, 0777) require.NoError(t, err) - err = clusterInstance.VtctldClientProcess.ExecuteCommand("WriteTopologyPath", topoCustomRuleFile, topoCustomRulePath) + err = clusterInstance.VtctldClientProcess.ExecuteCommand("--server", "internal", "WriteTopologyPath", topoCustomRuleFile, topoCustomRulePath) require.Nil(t, err, "error should be Nil") // And wait until the query fails with the right error.