Skip to content

Commit

Permalink
Test: testOldIndexes start nodes async
Browse files Browse the repository at this point in the history
  • Loading branch information
bleskes committed Mar 1, 2015
1 parent 1ca2d6b commit 7f61b15
Showing 1 changed file with 4 additions and 11 deletions.
Expand Up @@ -45,12 +45,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.*;

import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;

Expand Down Expand Up @@ -168,14 +163,12 @@ void assertRealtimeGetWorks() {

void assertNewReplicasWork() throws Exception {
final int numReplicas = randomIntBetween(2, 3);
for (int i = 0; i < numReplicas; ++i) {
logger.debug("Creating another node for replica " + i);
internalCluster().startNode(ImmutableSettings.builder()
logger.debug("Creating [{}] nodes for replicas", numReplicas);
internalCluster().startNodesAsync(numReplicas, ImmutableSettings.builder()
.put("data.node", true)
.put("master.node", false)
.put(InternalNode.HTTP_ENABLED, true) // for _upgrade
.build());
}
.build()).get();
client().admin().cluster().prepareHealth("test").setWaitForNodes("" + (numReplicas + 1));
assertAcked(client().admin().indices().prepareUpdateSettings("test").setSettings(ImmutableSettings.builder()
.put("number_of_replicas", numReplicas)).execute().actionGet());
Expand Down

0 comments on commit 7f61b15

Please sign in to comment.