Skip to content

Commit

Permalink
enable restore tests
Browse files Browse the repository at this point in the history
Signed-off-by: bansvaru <[email protected]>
  • Loading branch information
linuxpi committed Sep 6, 2023
1 parent f659908 commit 92f112f
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertHitCount;
import static org.hamcrest.Matchers.greaterThan;

@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE, numDataNodes = 0)
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0)
public class RemoteStoreRestoreIT extends BaseRemoteStoreRestoreIT {

/**
Expand Down Expand Up @@ -231,7 +231,6 @@ public void testRestoreFlowNoRedIndex() throws Exception {
* for multiple indices matching a wildcard name pattern.
* @throws IOException IO Exception.
*/
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/8480")
public void testRTSRestoreWithCommittedDataMultipleIndicesPatterns() throws Exception {
testRestoreFlowMultipleIndices(2, true, randomIntBetween(1, 5));
}
Expand All @@ -242,16 +241,16 @@ public void testRTSRestoreWithCommittedDataMultipleIndicesPatterns() throws Exce
* with all remote-enabled red indices considered for the restore by default.
* @throws IOException IO Exception.
*/
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/8480")
public void testRTSRestoreWithCommittedDataDefaultAllIndices() throws Exception {
int shardCount = randomIntBetween(1, 5);
prepareCluster(1, 3, INDEX_NAMES, 1, shardCount);
int replicaCount = 1;
prepareCluster(1, 3, INDEX_NAMES, replicaCount, shardCount);
String[] indices = INDEX_NAMES.split(",");
Map<String, Map<String, Long>> indicesStats = new HashMap<>();
for (String index : indices) {
Map<String, Long> indexStats = indexData(2, true, index);
indicesStats.put(index, indexStats);
assertEquals(shardCount, getNumShards(index).totalNumShards);
assertEquals(shardCount * (replicaCount + 1), getNumShards(index).totalNumShards);
}

for (String index : indices) {
Expand All @@ -273,7 +272,7 @@ public void testRTSRestoreWithCommittedDataDefaultAllIndices() throws Exception
ensureGreen(indices);

for (String index : indices) {
assertEquals(shardCount, getNumShards(index).totalNumShards);
assertEquals(shardCount * (replicaCount + 1), getNumShards(index).totalNumShards);
verifyRestoredData(indicesStats.get(index), index);
}
}
Expand Down Expand Up @@ -331,16 +330,16 @@ public void testRTSRestoreWithCommittedDataNotAllRedRemoteIndices() throws Excep
* except those matching the specified exclusion pattern.
* @throws IOException IO Exception.
*/
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/8480")
public void testRTSRestoreWithCommittedDataExcludeIndicesPatterns() throws Exception {
int shardCount = randomIntBetween(1, 5);
prepareCluster(1, 3, INDEX_NAMES, 1, shardCount);
int replicaCount = 1;
prepareCluster(1, 3, INDEX_NAMES, replicaCount, shardCount);
String[] indices = INDEX_NAMES.split(",");
Map<String, Map<String, Long>> indicesStats = new HashMap<>();
for (String index : indices) {
Map<String, Long> indexStats = indexData(2, true, index);
indicesStats.put(index, indexStats);
assertEquals(shardCount, getNumShards(index).totalNumShards);
assertEquals(shardCount * (replicaCount + 1), getNumShards(index).totalNumShards);
}

for (String index : indices) {
Expand Down Expand Up @@ -369,9 +368,9 @@ public void testRTSRestoreWithCommittedDataExcludeIndicesPatterns() throws Excep
PlainActionFuture.newFuture()
);
ensureGreen(indices[0], indices[1]);
assertEquals(shardCount, getNumShards(indices[0]).totalNumShards);
assertEquals(shardCount * (replicaCount + 1), getNumShards(indices[0]).totalNumShards);
verifyRestoredData(indicesStats.get(indices[0]), indices[0]);
assertEquals(shardCount, getNumShards(indices[1]).totalNumShards);
assertEquals(shardCount * (replicaCount + 1), getNumShards(indices[1]).totalNumShards);
verifyRestoredData(indicesStats.get(indices[1]), indices[1]);
ensureRed(indices[2], indices[3]);
}
Expand Down

0 comments on commit 92f112f

Please sign in to comment.