Skip to content

Commit

Permalink
Fix more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Sep 10, 2024
1 parent b24a1b1 commit baf6df2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ abstract class SnapshotManagementRestTestCase : IndexManagementRestTestCase() {
val startTimeMillis = desiredStartTimeMillis ?: (now().toEpochMilli() - millis)
val waitForActiveShards = if (isMultiNode) "all" else "1"
val response =
client().makeRequest(
adminClient().makeRequest(
"POST", "$INDEX_MANAGEMENT_INDEX/_update/${update.metadataID}?wait_for_active_shards=$waitForActiveShards",
StringEntity(
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

package org.opensearch.indexmanagement.snapshotmanagement.resthandler

import org.opensearch.client.Request
import org.opensearch.client.ResponseException
import org.opensearch.core.rest.RestStatus
import org.opensearch.indexmanagement.IndexManagementPlugin
import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX
import org.opensearch.indexmanagement.makeRequest
import org.opensearch.indexmanagement.snapshotmanagement.SnapshotManagementRestTestCase
import org.opensearch.indexmanagement.snapshotmanagement.randomSMPolicy
Expand Down Expand Up @@ -59,7 +61,8 @@ class RestStartSnapshotManagementIT : SnapshotManagementRestTestCase() {

fun `test starting a snapshot management policy with no config index fails`() {
try {
deleteIndex(IndexManagementPlugin.INDEX_MANAGEMENT_INDEX)
val request = Request("DELETE", "/$INDEX_MANAGEMENT_INDEX")
adminClient().performRequest(request)
client().makeRequest("POST", "${IndexManagementPlugin.SM_POLICIES_URI}/nonexistent_foo/_start")
fail("expected response exception")
} catch (e: ResponseException) {
Expand Down

0 comments on commit baf6df2

Please sign in to comment.