Skip to content

Commit

Permalink
kvcoord: make test less confusing
Browse files Browse the repository at this point in the history
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
  • Loading branch information
andreimatei committed May 19, 2021
1 parent 059aebf commit bc58328
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions pkg/kv/kvclient/kvcoord/replica_slice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}),
Expand Down

0 comments on commit bc58328

Please sign in to comment.