Skip to content

Commit

Permalink
Use adminClient when deleting ISM index in RestStopRollupActionIT
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <cwperx@amazon.com>
  • Loading branch information
cwperks committed Sep 10, 2024
1 parent 50f137b commit de48b38
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

package org.opensearch.indexmanagement.rollup.resthandler

import org.opensearch.client.Request
import org.opensearch.client.ResponseException
import org.opensearch.common.settings.Settings
import org.opensearch.core.rest.RestStatus
import org.opensearch.indexmanagement.IndexManagementIndices
import org.opensearch.indexmanagement.IndexManagementPlugin
import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX
import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.ROLLUP_JOBS_BASE_URI
import org.opensearch.indexmanagement.common.model.dimension.DateHistogram
import org.opensearch.indexmanagement.common.model.dimension.Terms
Expand Down Expand Up @@ -256,7 +258,8 @@ class RestStopRollupActionIT : RollupRestAPITestCase() {

fun `test stop rollup when multiple shards configured for IM config index`() {
// setup ism-config index with multiple primary shards
deleteIndex(IndexManagementPlugin.INDEX_MANAGEMENT_INDEX)
val deleteISMIndexRequest = Request("DELETE", "/$INDEX_MANAGEMENT_INDEX")
adminClient().performRequest(deleteISMIndexRequest)
val mapping = IndexManagementIndices.indexManagementMappings.trim().trimStart('{').trimEnd('}')
val settings =
Settings.builder()
Expand Down Expand Up @@ -313,7 +316,7 @@ class RestStopRollupActionIT : RollupRestAPITestCase() {

// clearing the config index to prevent other tests using this multi shard index
Thread.sleep(2000L)
deleteIndex(IndexManagementPlugin.INDEX_MANAGEMENT_INDEX)
adminClient().performRequest(deleteISMIndexRequest)
Thread.sleep(2000L)
}
}

0 comments on commit de48b38

Please sign in to comment.