Skip to content

Commit

Permalink
xds: fix flaky wrr test (#10005)
Browse files Browse the repository at this point in the history
  • Loading branch information
YifeiZhuang committed Apr 3, 2023
1 parent 7d5d25d commit 5c09616
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,8 @@ public void edfScheduler() {
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);
}
}

Expand Down

0 comments on commit 5c09616

Please sign in to comment.