From bc58328694b7bdb2ceac521e20ab884c20088629 Mon Sep 17 00:00:00 2001 From: Andrei Matei Date: Thu, 29 Apr 2021 12:43:23 -0400 Subject: [PATCH] kvcoord: make test less confusing TestReplicaSliceOptimizeReplicaOrder had two overlapping test cases around sorting by locality attributes. One was a super-set of the other, so this patch deletes the subset. The superset is renamed to not emphasize anything about the local node, since that's irrelevant to the test - the replica sorting logic does have special provisions for the local node, but even without those, in this test scenario the local node sorts first just based on its attributes. Release note: None --- pkg/kv/kvclient/kvcoord/replica_slice_test.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkg/kv/kvclient/kvcoord/replica_slice_test.go b/pkg/kv/kvclient/kvcoord/replica_slice_test.go index 4a861b9e6fc9..2bbf33a3b5ba 100644 --- a/pkg/kv/kvclient/kvcoord/replica_slice_test.go +++ b/pkg/kv/kvclient/kvcoord/replica_slice_test.go @@ -193,17 +193,6 @@ func TestReplicaSliceOptimizeReplicaOrder(t *testing.T) { { name: "order by locality matching", node: nodeDesc(t, 1, []string{"country=us", "region=west", "city=la"}), - slice: ReplicaSlice{ - info(t, 2, 2, []string{"country=us", "region=west", "city=sf"}), - info(t, 3, 3, []string{"country=uk", "city=london"}), - info(t, 3, 33, []string{"country=uk", "city=london"}), - info(t, 4, 4, []string{"country=us", "region=east", "city=ny"}), - }, - expOrdered: []roachpb.NodeID{2, 4, 3}, - }, - { - name: "order by locality matching, put node first", - node: nodeDesc(t, 1, []string{"country=us", "region=west", "city=la"}), slice: ReplicaSlice{ info(t, 1, 1, []string{"country=us", "region=west", "city=la"}), info(t, 2, 2, []string{"country=us", "region=west", "city=sf"}),