From 57e182011ddb7a62bbf44239919b4b6bffbbb09c Mon Sep 17 00:00:00 2001 From: Riya Saxena Date: Mon, 19 Feb 2024 14:03:17 -0800 Subject: [PATCH] added sleep for flaky tests Signed-off-by: Riya Saxena --- .../opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt | 2 ++ 1 file changed, 2 insertions(+) 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 79959c45a..4d4f17617 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt @@ -253,6 +253,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) { @@ -1331,6 +1332,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())