diff --git a/src/test/java/org/elasticsearch/test/integration/nested/SimpleNestedTests.java b/src/test/java/org/elasticsearch/test/integration/nested/SimpleNestedTests.java index 8072d76eb94..69da21087ee 100644 --- a/src/test/java/org/elasticsearch/test/integration/nested/SimpleNestedTests.java +++ b/src/test/java/org/elasticsearch/test/integration/nested/SimpleNestedTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.test.integration.nested; import org.apache.lucene.search.Explanation; +import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; import org.elasticsearch.action.delete.DeleteResponse; import org.elasticsearch.action.get.GetResponse; @@ -77,6 +78,7 @@ public class SimpleNestedTests extends AbstractSharedClusterTest { .endArray() .endObject()).execute().actionGet(); + waitForRelocation(ClusterHealthStatus.GREEN); // flush, so we fetch it from the index (as see that we filter nested docs) flush(); GetResponse getResponse = run(client().prepareGet("test", "type1", "1")); @@ -123,7 +125,7 @@ public class SimpleNestedTests extends AbstractSharedClusterTest { .endObject() .endArray() .endObject()).execute().actionGet(); - + waitForRelocation(ClusterHealthStatus.GREEN); // flush, so we fetch it from the index (as see that we filter nested docs) flush(); statusResponse = run(client().admin().indices().prepareStatus()); diff --git a/src/test/java/org/elasticsearch/test/integration/search/sort/SimpleSortTests.java b/src/test/java/org/elasticsearch/test/integration/search/sort/SimpleSortTests.java index 8f0ce355f35..099a6e7270c 100644 --- a/src/test/java/org/elasticsearch/test/integration/search/sort/SimpleSortTests.java +++ b/src/test/java/org/elasticsearch/test/integration/search/sort/SimpleSortTests.java @@ -48,11 +48,9 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchPhaseExecutionException; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.ShardSearchFailure; -import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.sort.SortBuilders; @@ -816,9 +814,8 @@ public class SimpleSortTests extends AbstractSharedClusterTest { .execute().actionGet(); assertThat("Expected exception but returned with", result, nullValue()); } catch (SearchPhaseExecutionException e) { - } - + ensureYellow(); SearchResponse searchResponse = client().prepareSearch() .setQuery(matchAllQuery()) .addSort(SortBuilders.fieldSort("kkk").ignoreUnmapped(true))