diff --git a/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/IndexingIT.java b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/IndexingIT.java index af14b28ae7d7a..543508d59d45b 100644 --- a/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/IndexingIT.java +++ b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/IndexingIT.java @@ -90,7 +90,8 @@ private void printClusterNodes() throws IOException, ParseException, URISyntaxEx private void waitForSearchableDocs(String index, int shardCount) throws Exception { Map primaryShardToNodeIDMap = new HashMap<>(); Map replicaShardToNodeIDMap = new HashMap<>(); - logger.info("--> _cat/shards \n{}", EntityUtils.toString(client().performRequest(new Request("GET", "/_cat/shards?v")).getEntity())); + waitForClusterHealthWithNoShardMigration(index, "green"); + logger.info("--> _cat/shards before search \n{}", EntityUtils.toString(client().performRequest(new Request("GET", "/_cat/shards?v")).getEntity())); Request request = new Request("GET", index + "/_stats"); request.addParameter("level", "shards");