From c29a7c14ffac13ecbe6a95c4d531b121100709de Mon Sep 17 00:00:00 2001 From: kkewwei Date: Thu, 26 Sep 2024 22:21:56 +0800 Subject: [PATCH] Fix Flaky Test org.opensearch.gateway.RecoveryFromGatewayIT.testShardStoreFetchMultiNodeMultiIndexesUsingBatchAction Signed-off-by: kkewwei --- .../java/org/opensearch/gateway/RecoveryFromGatewayIT.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java index 3aef3cdfd063d..1cfafeccdd40a 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java @@ -1382,7 +1382,6 @@ public void testShardStoreFetchMultiNodeMultiIndexesUsingBatchAction() throws Ex String indexName1 = "test1"; String indexName2 = "test2"; DiscoveryNode[] nodes = getDiscoveryNodes(); - System.out.println(); TransportNodesListShardStoreMetadataBatch.NodesStoreFilesMetadataBatch response = prepareAndSendRequest( new String[] { indexName1, indexName2 }, nodes @@ -1393,7 +1392,6 @@ public void testShardStoreFetchMultiNodeMultiIndexesUsingBatchAction() throws Ex ShardRouting[] shardRoutings = clusterSearchShardsGroup.getShards(); assertEquals(2, shardRoutings.length); for (ShardRouting shardRouting : shardRoutings) { - System.out.println("----------------" + shardRouting.shortSummary()); TransportNodesListShardStoreMetadataBatch.NodeStoreFilesMetadata nodeStoreFilesMetadata = response.getNodesMap() .get(shardRouting.currentNodeId()) .getNodeStoreFilesMetadataBatch() @@ -1511,6 +1509,7 @@ private void prepareIndices(String[] indices, int numberOfPrimaryShards, int num index(index, "type", "1", Collections.emptyMap()); flush(index); } + ensureGreen(indices); } private TransportNodesListShardStoreMetadataBatch.NodesStoreFilesMetadataBatch prepareAndSendRequest( @@ -1534,11 +1533,8 @@ private void assertNodeStoreFilesMetadataSuccessCase( assertNull(nodeStoreFilesMetadata.getStoreFileFetchException()); TransportNodesListShardStoreMetadataHelper.StoreFilesMetadata storeFileMetadata = nodeStoreFilesMetadata.storeFilesMetadata(); assertFalse(storeFileMetadata.isEmpty()); - System.out.println("----------" + storeFileMetadata); assertEquals(shardId, storeFileMetadata.shardId()); assertNotNull(storeFileMetadata.peerRecoveryRetentionLeases()); - System.out.println("----------" + storeFileMetadata.peerRecoveryRetentionLeases()); - } private void assertNodeGatewayStartedShardsHappyCase(GatewayStartedShard gatewayStartedShard) {