Skip to content

Commit e4a0817

Browse files
committed
fix edge case in test
1 parent 74ba7e0 commit e4a0817

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

balancer/deterministicsubsetting/balancer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (b *subsettingBalancer) prepareChildResolverState(s resolver.State) resolve
9090
excludedCount := backendCount % int(b.cfg.SubsetSize)
9191
excludedStart := (round * excludedCount) % backendCount
9292
excludedEnd := (excludedStart + excludedCount) % backendCount
93-
if excludedStart < excludedEnd {
93+
if excludedStart <= excludedEnd {
9494
addresses = append(addresses[:excludedStart], addresses[excludedEnd:]...)
9595
} else {
9696
addresses = addresses[excludedEnd:excludedStart]

balancer/deterministicsubsetting/e2e_test/subsetting_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ func checkRoundRobinRPCs(t *testing.T, ctx context.Context, clients []testgrpc.T
141141
} else {
142142
m[clientIdx] = struct{}{}
143143
}
144+
} else {
145+
t.Fatalf("peer.Addr == nil, peer: %v", peer)
144146
}
145147
}
146148
}

0 commit comments

Comments
 (0)