Skip to content

Commit

Permalink
Fix search template request (#43509)
Browse files Browse the repository at this point in the history
A seed was hit in (#43157) that caused mutateInstance to generate an identical 
instance. This change prevents that.
  • Loading branch information
jdconrad authored and jtibshirani committed Feb 8, 2021
1 parent f7531c7 commit c8e12ec
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ protected SearchTemplateRequest mutateInstance(SearchTemplateRequest instance) t
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<SearchTemplateRequest> mutator = randomFrom(mutators);
Expand Down

0 comments on commit c8e12ec

Please sign in to comment.