From 67e7602e4452ed6ecc0568da77fcd625bf3e3e73 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Oct 2023 17:46:38 +0000 Subject: [PATCH] Fix flaky testEqualsAndHashcode in SearchRequestTests (#10649) Signed-off-by: David Zane (cherry picked from commit d46a012c9fb01f7b3fb58a1c8fff1e352fe9efb8) Signed-off-by: github-actions[bot] --- .../java/org/opensearch/action/search/SearchRequestTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/test/java/org/opensearch/action/search/SearchRequestTests.java b/server/src/test/java/org/opensearch/action/search/SearchRequestTests.java index 90e154e6e66fc..f475ab7b4a72d 100644 --- a/server/src/test/java/org/opensearch/action/search/SearchRequestTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchRequestTests.java @@ -254,7 +254,9 @@ private SearchRequest mutate(SearchRequest searchRequest) { ); mutators.add(() -> mutation.source(randomValueOtherThan(searchRequest.source(), this::createSearchSourceBuilder))); mutators.add(() -> mutation.setCcsMinimizeRoundtrips(searchRequest.isCcsMinimizeRoundtrips() == false)); - mutators.add(() -> mutation.setPhaseTook(searchRequest.isPhaseTook() == false)); + mutators.add( + () -> mutation.setPhaseTook(searchRequest.isPhaseTook() == null ? randomBoolean() : searchRequest.isPhaseTook() == false) + ); mutators.add( () -> mutation.setCancelAfterTimeInterval( searchRequest.getCancelAfterTimeInterval() != null