From 9045235ee272ad1d9c004202e1f397d0c32c32bf Mon Sep 17 00:00:00 2001 From: Neetika Singhal Date: Wed, 27 Dec 2023 12:14:12 -0800 Subject: [PATCH] Fix SimpleNestedIT.testExplain flaky test Signed-off-by: Neetika Singhal --- .../java/org/opensearch/search/nested/SimpleNestedIT.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java b/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java index 6d0b074c3a660..6ebeda32ff468 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java @@ -487,7 +487,8 @@ public void testExplain() throws Exception { ) .setRefreshPolicy(IMMEDIATE) .get(); - indexRandomForConcurrentSearch("test"); + + indexRandomForMultipleSlices("test"); SearchResponse searchResponse = client().prepareSearch("test") .setQuery(nestedQuery("nested1", termQuery("nested1.n_field1", "n_value1"), ScoreMode.Total)) @@ -497,7 +498,7 @@ public void testExplain() throws Exception { assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L)); Explanation explanation = searchResponse.getHits().getHits()[0].getExplanation(); assertThat(explanation.getValue(), equalTo(searchResponse.getHits().getHits()[0].getScore())); - assertThat(explanation.toString(), startsWith("0.36464313 = Score based on 2 child docs in range from 0 to 1")); + assertThat(explanation.toString(), startsWith("0.36464313 = Score based on 2 child docs")); } public void testSimpleNestedSorting() throws Exception {