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..8e30b1c5d7674 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java @@ -487,6 +487,13 @@ public void testExplain() throws Exception { ) .setRefreshPolicy(IMMEDIATE) .get(); + + // refresh is important to enforce creation of a segment for document ingest above + // and prevent merging with deleted segemnts created by the index random function + // this ensures that the range doesnt change for the child docs asserted below + // ref: https://github.com/opensearch-project/OpenSearch/issues/11413 + refresh("test"); + indexRandomForConcurrentSearch("test"); SearchResponse searchResponse = client().prepareSearch("test")