From 498331d16f0c33dbf69f24438b0fbe74f94b60d6 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 12 Dec 2014 12:18:58 +0100 Subject: [PATCH] [TEST] Remove random templates for ConcurrentDynamicTemplateTests --- .../ConcurrentDynamicTemplateTests.java | 41 +------------------ 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/src/test/java/org/elasticsearch/indices/mapping/ConcurrentDynamicTemplateTests.java b/src/test/java/org/elasticsearch/indices/mapping/ConcurrentDynamicTemplateTests.java index 98306b8aa27..118aa9478e6 100644 --- a/src/test/java/org/elasticsearch/indices/mapping/ConcurrentDynamicTemplateTests.java +++ b/src/test/java/org/elasticsearch/indices/mapping/ConcurrentDynamicTemplateTests.java @@ -44,6 +44,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcke import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.emptyIterable; +@ElasticsearchIntegrationTest.ClusterScope(randomDynamicTemplates = false) // this test takes a long time to delete the idx if all fields are eager loading public class ConcurrentDynamicTemplateTests extends ElasticsearchIntegrationTest { private final String mappingType = "test-mapping"; @@ -100,45 +101,7 @@ public class ConcurrentDynamicTemplateTests extends ElasticsearchIntegrationTest Set fieldsIdx = Sets.newHashSet(); IndexRequestBuilder[] builders = new IndexRequestBuilder[numDocs]; - XContentBuilder mappings = XContentFactory.jsonBuilder().startObject().startObject("_default_"); - mappings.startArray("dynamic_templates") - .startObject() - .startObject("template-strings") - .field("match_mapping_type", "string") - .startObject("mapping") - .startObject("fielddata") - .field(FieldDataType.FORMAT_KEY, randomFrom("paged_bytes", "fst")) - .field(FieldMapper.Loading.KEY, FieldMapper.Loading.LAZY) // always use lazy loading - .endObject() - .endObject() - .endObject() - .endObject() - .startObject() - .startObject("template-longs") - .field("match_mapping_type", "long") - .startObject("mapping") - .startObject("fielddata") - .field(FieldDataType.FORMAT_KEY, randomFrom("array", "doc_values")) - .field(FieldMapper.Loading.KEY, FieldMapper.Loading.LAZY) - .endObject() - .endObject() - .endObject() - .endObject() - .startObject() - .startObject("template-doubles") - .field("match_mapping_type", "double") - .startObject("mapping") - .startObject("fielddata") - .field(FieldDataType.FORMAT_KEY, randomFrom("array", "doc_values")) - .field(FieldMapper.Loading.KEY, FieldMapper.Loading.LAZY) - .endObject() - .endObject() - .endObject() - .endObject() - .endArray(); - mappings.endObject().endObject(); - - assertAcked(client().admin().indices().prepareCreate("idx").addMapping("_default_", mappings)); + createIndex("idx"); ensureGreen("idx"); for (int i = 0; i < numDocs; ++i) { int fieldIdx = i % numberOfFields;