Skip to content

Commit

Permalink
Sleep thread to allow jobs to finish
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Au <[email protected]>
  • Loading branch information
Joshua152 committed Dec 30, 2023
1 parent 7dfaa44 commit ad1d765
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,6 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase()

protected fun ExplainFilter.toHttpEntity(): HttpEntity = StringEntity(toJsonString(), APPLICATION_JSON)

protected fun ExplainFilter.toHttpEntity(): HttpEntity = StringEntity(toJsonString(), ContentType.APPLICATION_JSON)

protected fun ChangePolicy.toHttpEntity(): HttpEntity {
var string = "{\"${ChangePolicy.POLICY_ID_FIELD}\":\"$policyID\","
if (state != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,9 @@ class RestExplainActionIT : IndexStateManagementRestTestCase() {

removePolicyFromIndex(indexName1)
removePolicyFromIndex(indexName2)

// wait for job to finish
Thread.sleep(1000)
}

fun `test explain filter failed index`() {
Expand Down Expand Up @@ -607,6 +610,9 @@ class RestExplainActionIT : IndexStateManagementRestTestCase() {

removePolicyFromIndex(indexName1)
removePolicyFromIndex(indexName2)

// wait for job to finish
Thread.sleep(1000)
}

@Suppress("UNCHECKED_CAST") // Do assertion of the response map here so we don't have many places to do suppression.
Expand Down

0 comments on commit ad1d765

Please sign in to comment.