HBASE-18071 Fix flaky test TestStochasticLoadBalancer#testBalanceCluster

Test was failing on clusters with large number of servers or regions. Using commonly using config settings like some other tests seems to work.

Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
Umesh Agashe 2017-05-19 10:02:45 -07:00 committed by Michael Stack
parent 5c728b0f0c
commit 8b70d043e4
1 changed files with 4 additions and 1 deletions

View File

@ -118,7 +118,10 @@ public class TestStochasticLoadBalancer extends BalancerTestBase {
*/
@Test
public void testBalanceCluster() throws Exception {
conf.setLong(StochasticLoadBalancer.MAX_STEPS_KEY, 2000000L);
conf.setLong("hbase.master.balancer.stochastic.maxRunningTime", 90 * 1000); // 90 sec
conf.setFloat("hbase.master.balancer.stochastic.maxMovePercent", 1.0f);
loadBalancer.setConf(conf);
for (int[] mockCluster : clusterStateMocks) {
Map<ServerName, List<HRegionInfo>> servers = mockClusterServers(mockCluster);
List<ServerAndLoad> list = convertToList(servers);