From 3efee2e2adf89f6b47827925ac066263593d12bc Mon Sep 17 00:00:00 2001 From: Jack Conradson Date: Tue, 25 Jun 2019 07:27:56 -0700 Subject: [PATCH] Fix search template request (#43509) A seed was hit in (#43157) that caused mutateInstance to generate an identical instance. This change prevents that. Signed-off-by: Peter Nied --- .../script/mustache/SearchTemplateRequestTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestTests.java index de85cb6ad12..47329828b00 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestTests.java @@ -64,8 +64,8 @@ public class SearchTemplateRequestTests extends AbstractWireSerializingTestCase< mutators.add(request -> request.setExplain(!request.isExplain())); mutators.add(request -> request.setSimulate(!request.isSimulate())); - mutators.add(request -> request.setRequest( - RandomSearchRequestGenerator.randomSearchRequest(SearchSourceBuilder::searchSource))); + mutators.add(request -> request.setRequest(randomValueOtherThan(request.getRequest(), + () -> RandomSearchRequestGenerator.randomSearchRequest(SearchSourceBuilder::searchSource)))); SearchTemplateRequest mutatedInstance = copyInstance(instance); Consumer mutator = randomFrom(mutators);