From 3417b945ddd58b148750403b3ec0f4467edfd29f Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Sun, 2 Jun 2013 13:02:36 +0200 Subject: [PATCH] stabelize SimpleQueryTest --- .../test/integration/search/query/SimpleQueryTests.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/elasticsearch/test/integration/search/query/SimpleQueryTests.java b/src/test/java/org/elasticsearch/test/integration/search/query/SimpleQueryTests.java index 4e88d9d7759..61bb0c795da 100644 --- a/src/test/java/org/elasticsearch/test/integration/search/query/SimpleQueryTests.java +++ b/src/test/java/org/elasticsearch/test/integration/search/query/SimpleQueryTests.java @@ -422,11 +422,10 @@ public class SimpleQueryTests extends AbstractSharedClusterTest { @Test public void testFiltersWithCustomCacheKey() throws Exception { + createIndex("test"); + ensureGreen(); client().prepareIndex("test", "type1", "1").setSource("field1", "value1").execute().actionGet(); - client().admin().indices().prepareRefresh().execute().actionGet(); - - client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForYellowStatus().execute().actionGet(); - + refresh(); SearchResponse searchResponse = client().prepareSearch("test").setQuery(constantScoreQuery(termsFilter("field1", "value1").cacheKey("test1"))).execute().actionGet(); assertThat("Failures " + Arrays.toString(searchResponse.getShardFailures()), searchResponse.getShardFailures().length, equalTo(0)); assertThat(searchResponse.getHits().totalHits(), equalTo(1l));