diff --git a/src/test/java/org/elasticsearch/search/matchedqueries/MatchedQueriesTests.java b/src/test/java/org/elasticsearch/search/matchedqueries/MatchedQueriesTests.java index c5fa4cb3a8c..cd3343e1c6b 100644 --- a/src/test/java/org/elasticsearch/search/matchedqueries/MatchedQueriesTests.java +++ b/src/test/java/org/elasticsearch/search/matchedqueries/MatchedQueriesTests.java @@ -216,8 +216,8 @@ public class MatchedQueriesTests extends ElasticsearchIntegrationTest { client().prepareIndex("test", "type1", "2").setSource("content", "consectetur adipisicing elit").get(); refresh(); - // Execute search 5 times to load it in cache - for (int i = 0; i < 5; i++) { + // Execute search at least two times to load it in cache + for (int i = 0; i < atLeast(2); i++) { SearchResponse searchResponse = client().prepareSearch() .setQuery( boolQuery()