stabelize SimpleQueryTest

This commit is contained in:
Simon Willnauer 2013-06-02 13:02:36 +02:00
parent a3f4d33aaa
commit 3417b945dd
1 changed files with 3 additions and 4 deletions

View File

@ -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));