Skip to content

Commit b75f27a

Browse files
authored
Fix Flaky Test SearchWithRandomExceptionsIT.testRandomExceptions (opensearch-project#16737)
Signed-off-by: kkewwei <kewei.11@bytedance.com> Signed-off-by: kkewwei <kkewwei@163.com>
1 parent 6d3fd37 commit b75f27a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/src/internalClusterTest/java/org/opensearch/search/basic/SearchWithRandomExceptionsIT.java

+5
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ public void testRandomExceptions() throws IOException, InterruptedException, Exe
193193
logger.info("expected SearchPhaseException: [{}]", ex.getMessage());
194194
}
195195
}
196+
197+
// as the index refresh may fail, so the translog in the index will be not flushed,
198+
// and `TranslogWriter.buffer` is not null, which causes arrays not been released,
199+
// so we need to close the index to release the arrays.
200+
cluster().wipeIndices("test");
196201
}
197202

198203
public static final String EXCEPTION_TOP_LEVEL_RATIO_KEY = "index.engine.exception.ratio.top";

0 commit comments

Comments
 (0)