Skip to content

Commit

Permalink
Fix Flaky Test org.opensearch.gateway.RecoveryFromGatewayIT.testShard…
Browse files Browse the repository at this point in the history
…StoreFetchMultiNodeMultiIndexesUsingBatchAction

Signed-off-by: kkewwei <[email protected]>
  • Loading branch information
kkewwei committed Sep 26, 2024
1 parent dc78714 commit c29a7c1
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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(
Expand All @@ -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) {
Expand Down

0 comments on commit c29a7c1

Please sign in to comment.