[TEST] relax size test, to not run into OOM

This commit is contained in:
Shay Banon 2014-07-09 23:03:06 +02:00
parent 94539979c7
commit 808c52706a
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@
package org.elasticsearch.cluster; package org.elasticsearch.cluster;
import com.carrotsearch.randomizedtesting.annotations.Repeat;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
@ -127,7 +128,7 @@ public class SimpleClusterStateTests extends ElasticsearchIntegrationTest {
@Test @Test
public void testLargeClusterStatePublishing() throws Exception { public void testLargeClusterStatePublishing() throws Exception {
int estimatedBytesSize = scaledRandomIntBetween(ByteSizeValue.parseBytesSizeValue("10k").bytesAsInt(), ByteSizeValue.parseBytesSizeValue("1m").bytesAsInt()); int estimatedBytesSize = scaledRandomIntBetween(ByteSizeValue.parseBytesSizeValue("10k").bytesAsInt(), ByteSizeValue.parseBytesSizeValue("256k").bytesAsInt());
XContentBuilder mapping = XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties"); XContentBuilder mapping = XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties");
int counter = 0; int counter = 0;
int numberOfFields = 0; int numberOfFields = 0;
@ -143,6 +144,7 @@ public class SimpleClusterStateTests extends ElasticsearchIntegrationTest {
mapping.endObject().endObject().endObject(); mapping.endObject().endObject().endObject();
// if the create index is ack'ed, then all nodes have successfully processed the cluster state // if the create index is ack'ed, then all nodes have successfully processed the cluster state
assertAcked(client().admin().indices().prepareCreate("test").addMapping("type", mapping).get()); assertAcked(client().admin().indices().prepareCreate("test").addMapping("type", mapping).get());
ensureGreen(); // wait for green state, so its both green, and there are no more pending events
MappingMetaData masterMappingMetaData = client().admin().indices().prepareGetMappings("test").setTypes("type").get().getMappings().get("test").get("type"); MappingMetaData masterMappingMetaData = client().admin().indices().prepareGetMappings("test").setTypes("type").get().getMappings().get("test").get("type");
for (Client client : clients()) { for (Client client : clients()) {
MappingMetaData mappingMetadata = client.admin().indices().prepareGetMappings("test").setTypes("type").setLocal(true).get().getMappings().get("test").get("type"); MappingMetaData mappingMetadata = client.admin().indices().prepareGetMappings("test").setTypes("type").setLocal(true).get().getMappings().get("test").get("type");