Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
skip RefreshSearchAnalyzerActionIT for Infra IT (#315)
Browse files Browse the repository at this point in the history
* address comment
some writting changes just for consistency with AES side
  • Loading branch information
bowenlan-amzn authored Oct 22, 2020
1 parent 76bd1fd commit 2dbe660
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ class AttemptSetReadOnlyStep(
try {
val updateSettingsRequest = UpdateSettingsRequest()
.indices(indexName)
.settings(
Settings.builder().put(SETTING_BLOCKS_WRITE, true)
)
.settings(Settings.builder().put(SETTING_BLOCKS_WRITE, true))
val response: AcknowledgedResponse = client.admin().indices()
.suspendUntil { updateSettings(updateSettingsRequest, it) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@ class IndexManagementIndicesIT : IndexStateManagementRestTestCase() {

waitFor { assertEquals(newPolicy.id, getManagedIndexConfig(index)?.changePolicy?.policyID) }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ import org.elasticsearch.test.rest.ESRestTestCase

abstract class IndexManagementRestTestCase : ESRestTestCase() {

protected val isLocalTest = clusterName() == "integTest"
private fun clusterName(): String {
return System.getProperty("tests.clustername")
}

fun Response.asMap(): Map<String, Any> = entityAsMap(this)

protected fun Response.restStatus(): RestStatus = RestStatus.fromCode(this.statusLine.statusCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class ManagedIndexRunnerIT : IndexStateManagementRestTestCase() {

val managedIndexConfig = getExistingManagedIndexConfig(indexName)

assertEquals("Created managed index did not default to 5 minutes", 5, (managedIndexConfig.jobSchedule as IntervalSchedule).interval)
assertEquals("Created managed index did not default to ${ManagedIndexSettings.DEFAULT_JOB_INTERVAL}minutes",
ManagedIndexSettings.DEFAULT_JOB_INTERVAL, (managedIndexConfig.jobSchedule as IntervalSchedule).interval)

// init policy
updateManagedIndexConfigStartTime(managedIndexConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,20 @@ import org.elasticsearch.client.Request
import org.elasticsearch.common.io.Streams
import org.elasticsearch.common.settings.Settings
import org.elasticsearch.common.xcontent.XContentType
import org.junit.Assume
import org.junit.Before
import java.io.InputStreamReader
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets
import java.nio.file.Files

class RefreshSearchAnalyzerActionIT : IndexManagementRestTestCase() {

@Before
fun checkIfLocalCluster() {
Assume.assumeTrue(isLocalTest)
}

fun `test index time analyzer`() {
val buildDir = System.getProperty("buildDir")
val numNodes = System.getProperty("cluster.number_of_nodes", "1").toInt()
Expand Down

0 comments on commit 2dbe660

Please sign in to comment.