diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index 2b0113e9ce2..ac90cc0b8e5 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -4605,7 +4605,7 @@ func TestDeleteTablets(t *testing.T) { resp, err := vtctld.GetTablets(ctx, &vtctldatapb.GetTabletsRequest{}) assert.NoError(t, err, "cannot look up tablets from topo after issuing DeleteTablets request") - testutil.AssertSameTablets(t, tt.expectedRemainingTablets, resp.Tablets) + utils.MustMatch(t, tt.expectedRemainingTablets, resp.Tablets) } // Run the test @@ -13338,7 +13338,7 @@ func TestTabletExternallyReparented(t *testing.T) { resp, err := vtctld.GetTablets(ctx, &vtctldatapb.GetTabletsRequest{}) require.NoError(t, err, "cannot get all tablets in the topo") - testutil.AssertSameTablets(t, tt.expectedTopo, resp.Tablets) + utils.MustMatch(t, tt.expectedTopo, resp.Tablets) }() } diff --git a/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go b/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go index 20ad0f692b0..eaf0786b12d 100644 --- a/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go +++ b/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go @@ -18,15 +18,12 @@ package testutil import ( "encoding/json" - "fmt" - "sort" "testing" "github.com/stretchr/testify/assert" "vitess.io/vitess/go/test/utils" logutilpb "vitess.io/vitess/go/vt/proto/logutil" - topodatapb "vitess.io/vitess/go/vt/proto/topodata" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" ) @@ -108,16 +105,6 @@ func AssertPlannedReparentShardResponsesEqual(t *testing.T, expected *vtctldatap utils.MustMatch(t, expected, actual) } -func AssertSameTablets(t *testing.T, expected, actual []*topodatapb.Tablet) { - sort.Slice(expected, func(i, j int) bool { - return fmt.Sprintf("%v", expected[i]) < fmt.Sprintf("%v", expected[j]) - }) - sort.Slice(actual, func(i, j int) bool { - return fmt.Sprintf("%v", actual[i]) < fmt.Sprintf("%v", actual[j]) - }) - utils.MustMatch(t, expected, actual) -} - // AssertKeyspacesEqual is a convenience function to assert that two // vtctldatapb.Keyspace objects are equal, after clearing out any reserved // proto XXX_ fields.