From a4fc11b3d1268ffefa27d53f57b67697993136ed Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 14 Jun 2013 12:06:47 +0200 Subject: [PATCH] Wait for Yellow state after indexing --- .../integration/search/highlight/HighlighterSearchTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/elasticsearch/test/integration/search/highlight/HighlighterSearchTests.java b/src/test/java/org/elasticsearch/test/integration/search/highlight/HighlighterSearchTests.java index 85dfd7d76c0..f492fd14bcb 100644 --- a/src/test/java/org/elasticsearch/test/integration/search/highlight/HighlighterSearchTests.java +++ b/src/test/java/org/elasticsearch/test/integration/search/highlight/HighlighterSearchTests.java @@ -289,14 +289,15 @@ public class HighlighterSearchTests extends AbstractSharedClusterTest { .put("analysis.analyzer.name2_index_analyzer.filter", "my_ngram") .put("analysis.analyzer.name_search_analyzer.tokenizer", "whitespace")) .execute().actionGet(); - client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForYellowStatus().execute().actionGet(); client().prepareIndex("test", "test", "1") .setSource(XContentFactory.jsonBuilder() .startObject() .field("name", "logicacmg ehemals avinci - the know how company") .field("name2", "logicacmg ehemals avinci - the know how company") .endObject()) - .setRefresh(true).execute().actionGet(); + .execute().actionGet(); + refresh(); + ensureYellow(); SearchResponse search = client().prepareSearch().setQuery(matchQuery("name", "logica m")).addHighlightedField("name").execute().actionGet(); assertHighlight(search, 0, "name", 0, equalTo("logicacmg ehemals avinci - the know how company"));