diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java index c3661c0354e41..2cd46e326dcfb 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -245,7 +245,7 @@ public void testIndexReopenClose() throws Exception { client().prepareIndex(INDEX_NAME).setId("1").setSource("foo", "bar").setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get(); refresh(INDEX_NAME); - final int initialDocCount = scaledRandomIntBetween(10000, 200000); + final int initialDocCount = scaledRandomIntBetween(100, 200); try ( BackgroundIndexer indexer = new BackgroundIndexer( INDEX_NAME, @@ -259,20 +259,13 @@ public void testIndexReopenClose() throws Exception { ) { indexer.start(initialDocCount); waitForDocs(initialDocCount, indexer); - refresh(INDEX_NAME); + flush(INDEX_NAME); waitForReplicaUpdate(); } - flushAndRefresh(INDEX_NAME); - waitForReplicaUpdate(); - logger.info("--> Closing the index "); client().admin().indices().prepareClose(INDEX_NAME).get(); - // Add another node to kick off TransportNodesListGatewayStartedShards which fetches latestReplicationCheckpoint for SegRep enabled - // indices - final String replica2 = internalCluster().startNode(); - logger.info("--> Opening the index"); client().admin().indices().prepareOpen(INDEX_NAME).get(); }