[TEST] replaced cluster().size() calls with immutableCluster().size
This commit is contained in:
parent
8fe6fe638d
commit
bae3203e3b
|
@ -88,7 +88,7 @@ public class HotThreadsTest extends ElasticsearchIntegrationTest {
|
||||||
try {
|
try {
|
||||||
assertThat(nodeHotThreads, notNullValue());
|
assertThat(nodeHotThreads, notNullValue());
|
||||||
Map<String,NodeHotThreads> nodesMap = nodeHotThreads.getNodesMap();
|
Map<String,NodeHotThreads> nodesMap = nodeHotThreads.getNodesMap();
|
||||||
assertThat(nodesMap.size(), equalTo(cluster().size()));
|
assertThat(nodesMap.size(), equalTo(immutableCluster().size()));
|
||||||
for (NodeHotThreads ht : nodeHotThreads) {
|
for (NodeHotThreads ht : nodeHotThreads) {
|
||||||
assertNotNull(ht.getHotThreads());
|
assertNotNull(ht.getHotThreads());
|
||||||
//logger.info(ht.getHotThreads());
|
//logger.info(ht.getHotThreads());
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class SimpleClusterStateTests extends ElasticsearchIntegrationTest {
|
||||||
@Test
|
@Test
|
||||||
public void testNodes() throws Exception {
|
public void testNodes() throws Exception {
|
||||||
ClusterStateResponse clusterStateResponse = client().admin().cluster().prepareState().clear().setNodes(true).get();
|
ClusterStateResponse clusterStateResponse = client().admin().cluster().prepareState().clear().setNodes(true).get();
|
||||||
assertThat(clusterStateResponse.getState().nodes().nodes().size(), is(cluster().size()));
|
assertThat(clusterStateResponse.getState().nodes().nodes().size(), is(immutableCluster().size()));
|
||||||
|
|
||||||
ClusterStateResponse clusterStateResponseFiltered = client().admin().cluster().prepareState().clear().get();
|
ClusterStateResponse clusterStateResponseFiltered = client().admin().cluster().prepareState().clear().get();
|
||||||
assertThat(clusterStateResponseFiltered.getState().nodes().nodes().size(), is(0));
|
assertThat(clusterStateResponseFiltered.getState().nodes().nodes().size(), is(0));
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class AckClusterUpdateSettingsTests extends ElasticsearchIntegrationTest
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int minimumNumberOfShards() {
|
protected int minimumNumberOfShards() {
|
||||||
return cluster().size();
|
return immutableCluster().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class ClusterRerouteTests extends ElasticsearchIntegrationTest {
|
||||||
logger.info("--> starting 2 nodes");
|
logger.info("--> starting 2 nodes");
|
||||||
String node_1 = cluster().startNode(commonSettings);
|
String node_1 = cluster().startNode(commonSettings);
|
||||||
cluster().startNode(commonSettings);
|
cluster().startNode(commonSettings);
|
||||||
assertThat(cluster().size(), equalTo(2));
|
assertThat(immutableCluster().size(), equalTo(2));
|
||||||
ClusterHealthResponse healthResponse = client().admin().cluster().prepareHealth().setWaitForNodes("2").execute().actionGet();
|
ClusterHealthResponse healthResponse = client().admin().cluster().prepareHealth().setWaitForNodes("2").execute().actionGet();
|
||||||
assertThat(healthResponse.isTimedOut(), equalTo(false));
|
assertThat(healthResponse.isTimedOut(), equalTo(false));
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ public class ClusterRerouteTests extends ElasticsearchIntegrationTest {
|
||||||
logger.info("--> starting a node");
|
logger.info("--> starting a node");
|
||||||
String node_1 = cluster().startNode(commonSettings);
|
String node_1 = cluster().startNode(commonSettings);
|
||||||
|
|
||||||
assertThat(cluster().size(), equalTo(1));
|
assertThat(immutableCluster().size(), equalTo(1));
|
||||||
ClusterHealthResponse healthResponse = client().admin().cluster().prepareHealth().setWaitForNodes("1").execute().actionGet();
|
ClusterHealthResponse healthResponse = client().admin().cluster().prepareHealth().setWaitForNodes("1").execute().actionGet();
|
||||||
assertThat(healthResponse.isTimedOut(), equalTo(false));
|
assertThat(healthResponse.isTimedOut(), equalTo(false));
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ public class ClusterRerouteTests extends ElasticsearchIntegrationTest {
|
||||||
|
|
||||||
logger.info("--> starting a second node");
|
logger.info("--> starting a second node");
|
||||||
String node_2 = cluster().startNode(commonSettings);
|
String node_2 = cluster().startNode(commonSettings);
|
||||||
assertThat(cluster().size(), equalTo(2));
|
assertThat(immutableCluster().size(), equalTo(2));
|
||||||
healthResponse = client().admin().cluster().prepareHealth().setWaitForNodes("2").execute().actionGet();
|
healthResponse = client().admin().cluster().prepareHealth().setWaitForNodes("2").execute().actionGet();
|
||||||
assertThat(healthResponse.isTimedOut(), equalTo(false));
|
assertThat(healthResponse.isTimedOut(), equalTo(false));
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class FilteringAllocationTests extends ElasticsearchIntegrationTest {
|
||||||
logger.info("--> starting 2 nodes");
|
logger.info("--> starting 2 nodes");
|
||||||
final String node_0 = cluster().startNode();
|
final String node_0 = cluster().startNode();
|
||||||
final String node_1 = cluster().startNode();
|
final String node_1 = cluster().startNode();
|
||||||
assertThat(cluster().size(), equalTo(2));
|
assertThat(immutableCluster().size(), equalTo(2));
|
||||||
|
|
||||||
logger.info("--> creating an index with no replicas");
|
logger.info("--> creating an index with no replicas");
|
||||||
client().admin().indices().prepareCreate("test")
|
client().admin().indices().prepareCreate("test")
|
||||||
|
@ -84,7 +84,7 @@ public class FilteringAllocationTests extends ElasticsearchIntegrationTest {
|
||||||
logger.info("--> starting 2 nodes");
|
logger.info("--> starting 2 nodes");
|
||||||
final String node_0 = cluster().startNode();
|
final String node_0 = cluster().startNode();
|
||||||
final String node_1 = cluster().startNode();
|
final String node_1 = cluster().startNode();
|
||||||
assertThat(cluster().size(), equalTo(2));
|
assertThat(immutableCluster().size(), equalTo(2));
|
||||||
|
|
||||||
logger.info("--> creating an index with no replicas");
|
logger.info("--> creating an index with no replicas");
|
||||||
client().admin().indices().prepareCreate("test")
|
client().admin().indices().prepareCreate("test")
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class ShardsAllocatorModuleTests extends ElasticsearchIntegrationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertAllocatorInstance(Settings settings, Class<? extends ShardsAllocator> clazz) {
|
private void assertAllocatorInstance(Settings settings, Class<? extends ShardsAllocator> clazz) {
|
||||||
while (cluster().size() != 0) {
|
while (immutableCluster().size() != 0) {
|
||||||
cluster().stopRandomNode();
|
cluster().stopRandomNode();
|
||||||
}
|
}
|
||||||
cluster().startNode(settings);
|
cluster().startNode(settings);
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class ConcurrentDocumentOperationTests extends ElasticsearchIntegrationTe
|
||||||
|
|
||||||
logger.info("done indexing, check all have the same field value");
|
logger.info("done indexing, check all have the same field value");
|
||||||
Map masterSource = client().prepareGet("test", "type1", "1").execute().actionGet().getSourceAsMap();
|
Map masterSource = client().prepareGet("test", "type1", "1").execute().actionGet().getSourceAsMap();
|
||||||
for (int i = 0; i < (cluster().size() * 5); i++) {
|
for (int i = 0; i < (immutableCluster().size() * 5); i++) {
|
||||||
assertThat(client().prepareGet("test", "type1", "1").execute().actionGet().getSourceAsMap(), equalTo(masterSource));
|
assertThat(client().prepareGet("test", "type1", "1").execute().actionGet().getSourceAsMap(), equalTo(masterSource));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue