From 5c5e13abce3ef1854af24ada7e5d7fa21d37f713 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Mon, 30 Jun 2014 22:32:25 +0200 Subject: [PATCH] [TEST] properly wait for mappings when needed --- .../indices/mapping/SimpleGetFieldMappingsTests.java | 1 + src/test/java/org/elasticsearch/percolator/PercolatorTests.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/test/java/org/elasticsearch/indices/mapping/SimpleGetFieldMappingsTests.java b/src/test/java/org/elasticsearch/indices/mapping/SimpleGetFieldMappingsTests.java index f25f6936d7d..da81d8438ec 100644 --- a/src/test/java/org/elasticsearch/indices/mapping/SimpleGetFieldMappingsTests.java +++ b/src/test/java/org/elasticsearch/indices/mapping/SimpleGetFieldMappingsTests.java @@ -133,6 +133,7 @@ public class SimpleGetFieldMappingsTests extends ElasticsearchIntegrationTest { client().prepareIndex("test", "type", "1").setSource("num", 1).get(); ensureYellow(); + waitForConcreteMappingsOnAll("test", "type", "num"); // for num, we need to wait... GetFieldMappingsResponse response = client().admin().indices().prepareGetFieldMappings().setFields("num", "field1", "subfield").includeDefaults(true).get(); diff --git a/src/test/java/org/elasticsearch/percolator/PercolatorTests.java b/src/test/java/org/elasticsearch/percolator/PercolatorTests.java index a30d3ed2cfa..3bfffde0f0b 100644 --- a/src/test/java/org/elasticsearch/percolator/PercolatorTests.java +++ b/src/test/java/org/elasticsearch/percolator/PercolatorTests.java @@ -1756,6 +1756,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest { assertMatchCount(response, 0l); assertThat(response.getMatches(), arrayWithSize(0)); + ensureYellow("test"); // wait for at least primaries allocations so concretely allocated on it waitForConcreteMappingsOnAll("test", "type1", "field1", "field2"); GetMappingsResponse mappingsResponse = client().admin().indices().prepareGetMappings("test").get();