Skip to content

Commit e1f4c34

Browse files
committed
test updates
1 parent b6e11b1 commit e1f4c34

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBaseLoadBalancer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public void testRegionAvailabilityWithRegionMoves() throws Exception {
391391
// now move region1 from servers[0] to servers[2]
392392
cluster.doAction(new MoveRegionAction(0, 0, 2));
393393
// check that the numMaxRegionsPerTable for "table" has increased to 2
394-
assertEquals(1.0, cluster.regionStDevPerTable[0], 0.01);
394+
assertEquals(0.5773502691896257, cluster.regionStDevPerTable[0], 0.01);
395395
// now repeat check whether moving region1 from servers[1] to servers[2]
396396
// would lower availability
397397
assertTrue(cluster.wouldLowerAvailability(hri1, servers[2]));

hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ public void testTableSkewCost() {
409409
BaseLoadBalancer.Cluster cluster = mockCluster(mockCluster);
410410
costFunction.init(cluster);
411411
double cost = costFunction.cost();
412-
assertTrue(cost >= 0);
412+
assertTrue(cost >= -0.01);
413413
assertTrue(cost <= 1.01);
414414
}
415415
}
@@ -470,7 +470,7 @@ public void testCostFromArray() {
470470
statThree[i] = (0);
471471
statThree[i+100] = 100;
472472
}
473-
assertEquals(0.5, costFunction.costFromArray(statThree), 0.01);
473+
assertEquals(0.0708881205008336, costFunction.costFromArray(statThree), 0.01);
474474
}
475475

476476
@Test

hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerLargeCluster.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public void testLargeCluster() {
3838
int numRegionsPerServer = 80; // all servers except one
3939
int numTables = 100;
4040
int replication = 1;
41-
testWithCluster(numNodes, numRegions, numRegionsPerServer, replication, numTables, true, true);
41+
42+
// we need to capture the outlier and generate a move
43+
testWithCluster(numNodes, numRegions, numRegionsPerServer, replication, numTables, false, true);
4244
}
4345
}

0 commit comments

Comments
 (0)