Skip to content

Commit 482490b

Browse files
committed
fix the failed test
1 parent 4c50ed1 commit 482490b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -2111,10 +2111,11 @@ public void testWeightedPlacementAndReplaceBookieWithoutEnoughBookiesInSameRack(
21112111
selectionCounts.put(replacedBookie, selectionCounts.get(replacedBookie) + 1);
21122112
}
21132113
/*
2114-
* since addr2 has to be replaced, the remaining bookies weight are - 50, 100, 200, 500 (10*50)
2115-
* So the median calculated by WeightedRandomSelection is (100 + 200) / 2 = 150
2114+
* Even though addr2 has to be replaced, but being excluded bookie weight is not excluded in the choose list.
2115+
* All the bookies weight are - 50, 100, 100, 200, 500 (10*50)
2116+
* So the median calculated by WeightedRandomSelection is 100
21162117
*/
2117-
double medianWeight = 150;
2118+
double medianWeight = 100;
21182119
double medianSelectionCounts = (double) (medianWeight / bookieInfoMap.get(addr1.toBookieId()).getWeight())
21192120
* selectionCounts.get(addr1.toBookieId());
21202121
double observedMultiple1 = ((double) selectionCounts.get(addr4.toBookieId())

0 commit comments

Comments
 (0)