From bec5d432284c0dc6b07052fc3aa1e7cf31f7a69a Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Fri, 10 Nov 2017 18:51:58 +0100 Subject: [PATCH] [Test] #27342 Fix SearchRequests#testValidate --- .../java/org/elasticsearch/search/SearchRequestTests.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/test/java/org/elasticsearch/search/SearchRequestTests.java b/core/src/test/java/org/elasticsearch/search/SearchRequestTests.java index d37b8b4b133..eb643885e83 100644 --- a/core/src/test/java/org/elasticsearch/search/SearchRequestTests.java +++ b/core/src/test/java/org/elasticsearch/search/SearchRequestTests.java @@ -91,8 +91,10 @@ public class SearchRequestTests extends AbstractSearchTestCase { assertNull(validationErrors); } { - // disabeling `track_total_hits` isn't valid in scroll context + // disabling `track_total_hits` isn't valid in scroll context SearchRequest searchRequest = createSearchRequest().source(new SearchSourceBuilder()); + // make sure we don't set the request cache for a scroll query + searchRequest.requestCache(false); searchRequest.scroll(new TimeValue(1000)); searchRequest.source().trackTotalHits(false); ActionRequestValidationException validationErrors = searchRequest.validate(); @@ -103,6 +105,8 @@ public class SearchRequestTests extends AbstractSearchTestCase { { // scroll and `from` isn't valid SearchRequest searchRequest = createSearchRequest().source(new SearchSourceBuilder()); + // make sure we don't set the request cache for a scroll query + searchRequest.requestCache(false); searchRequest.scroll(new TimeValue(1000)); searchRequest.source().from(10); ActionRequestValidationException validationErrors = searchRequest.validate();