diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt index 86207bab8..2c019d20e 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt @@ -250,6 +250,7 @@ class SecureMonitorRestApiIT : AlertingRestTestCase() { ) ) val createResponse = userClient?.makeRequest("POST", ALERTING_BASE_URI, emptyMap(), monitor.toHttpEntity()) + Thread.sleep(30000) assertEquals("Create monitor failed", RestStatus.CREATED, createResponse?.restStatus()) fail("Expected 403 Method FORBIDDEN response") } catch (e: ResponseException) { @@ -1314,6 +1315,7 @@ class SecureMonitorRestApiIT : AlertingRestTestCase() { try { val response = executeMonitor(userClient as RestClient, modifiedMonitor, params = DRYRUN_MONITOR) + Thread.sleep(20000) val output = entityAsMap(response) val inputResults = output.stringMap("input_results") assertTrue("Missing monitor error message", (inputResults?.get("error") as String).isNotEmpty())