Skip to content

Commit

Permalink
Fix SimpleNestedIT.testExplain flaky test
Browse files Browse the repository at this point in the history
Signed-off-by: Neetika Singhal <[email protected]>
  • Loading branch information
neetikasinghal committed Jan 4, 2024
1 parent 714fa73 commit 9045235
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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 {
Expand Down

0 comments on commit 9045235

Please sign in to comment.