diff --git a/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java b/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java index 99824fe9e2..812ec43fee 100644 --- a/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java +++ b/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java @@ -227,6 +227,9 @@ public void stop(boolean checkActiveThreads) throws IOException { Client client = clientNode().getInternalNodeClient(); AdminClient adminClient = client.admin(); + adminClient.indices().prepareFlush().get(); + adminClient.indices().prepareRefresh().get(); + if (checkActiveThreads) { int maxRetries = 3; int retryCount = 0;