Allow up to 10% unbalance in random allocator tests

This commit is contained in:
Simon Willnauer 2013-08-31 09:12:25 +02:00
parent be09103258
commit 69848210d6
1 changed files with 2 additions and 2 deletions

View File

@ -157,8 +157,8 @@ public class RandomAllocationDeciderTests extends ElasticsearchTestCase {
int shards = clusterState.routingNodes().shardsWithState(ShardRoutingState.STARTED).size();
assertThat(shards, equalTo(totalNumShards));
final int numNodes = clusterState.nodes().size();
final int upperBound = (int) Math.round(((shards / numNodes) * 1.05));
final int lowerBound = (int) Math.round(((shards / numNodes) * 0.05));
final int upperBound = (int) Math.round(((shards / numNodes) * 1.10));
final int lowerBound = (int) Math.round(((shards / numNodes) * 0.90));
for (int i = 0; i < nodeIdCounter; i++) {
if (clusterState.getRoutingNodes().node("NODE_" + i) == null) {
continue;