Skip to content

Commit

Permalink
Prob fixes the flaky test in ChangePolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenlan-amzn committed Aug 2, 2021
1 parent f31a5c6 commit feca54b
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,15 @@ class RestChangePolicyActionIT : IndexStateManagementRestTestCase() {
// speed up to third execution where we transition to second state
updateManagedIndexConfigStartTime(firstManagedIndexConfig)

logger.info("time before check")
waitFor {
getExplainManagedIndexMetaData(firstIndex).let {
assertEquals(it.copy(stateMetaData = it.stateMetaData?.copy(name = secondState.name)), it)
}
// getExplainManagedIndexMetaData(firstIndex).let {
// assertEquals(it.copy(stateMetaData = it.stateMetaData?.copy(name = secondState.name)), it)
// }
assertEquals(secondState.name, getExplainManagedIndexMetaData(firstIndex).stateMetaData?.name)
logger.info("Explain firstIndex before change policy: ${getExplainManagedIndexMetaData(firstIndex)}")
}
logger.info("time after check")

// create second index
val (secondIndex) = createIndex("second_index", policy.id)
Expand All @@ -501,6 +505,7 @@ class RestChangePolicyActionIT : IndexStateManagementRestTestCase() {
val responseMap = response.asMap()
logger.info("Change policy response: $responseMap")
assertAffectedIndicesResponseIsEqual(expectedResponse, responseMap)
fail()

waitFor {
// The first managed index should not have a change policy added to it as it should of been filtered out from the states filter
Expand Down

0 comments on commit feca54b

Please sign in to comment.