浏览代码

[TEST] properly wait for mappings when needed

Shay Banon 11 年之前
父节点
当前提交
5c5e13abce

+ 1 - 0
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();
 

+ 1 - 0
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();