mirror of https://github.com/grpc/grpc-java.git
xds: fix flaky wrr test (#10004)
This commit is contained in:
parent
10f5e5afd6
commit
bbe5a0227d
|
@ -638,7 +638,8 @@ public class WeightedRoundRobinLoadBalancerTest {
|
|||
pickCount.put(result, pickCount.getOrDefault(result, 0) + 1);
|
||||
}
|
||||
for (int i = 0; i < capacity; i++) {
|
||||
assertThat(Math.abs(pickCount.get(i) / 1000.0 - weights[i] / totalWeight) ).isAtMost(0.01);
|
||||
assertThat(Math.abs(pickCount.getOrDefault(i, 0) / 1000.0 - weights[i] / totalWeight) )
|
||||
.isAtMost(0.01);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue