From 2a9bcd682e9cb63253e7a8478be881e046fa43ef Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Mon, 3 Jul 2023 16:50:31 +0800 Subject: [PATCH] remove runtime notification settings (#839) Signed-off-by: Hailong Cui --- .../filter/NotificationActionListener.kt | 7 +- .../filter/NotificationActionListenerIT.kt | 115 ++++++++++++------ 2 files changed, 82 insertions(+), 40 deletions(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt index cf44441fe..81411165c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt @@ -235,9 +235,12 @@ class NotificationActionListener>> + )["hits"]!!["total"]!!["value"] + ) + + try { + client.makeRequest("GET", "_plugins/_im/lron/LRON:$taskId") + } catch (e: ResponseException) { + // runtime policy been removed + Assert.assertTrue(e.response.restStatus() == RestStatus.NOT_FOUND) + } + } + } + + private fun performReindex(): Response { + insertSampleData("source-index", 10) + createIndex("reindex-dest", Settings.EMPTY) + + val response = client.makeRequest( + "POST", "_reindex?wait_for_completion=false", + StringEntity( + """ + { + "source": { + "index": "source-index" + }, + "dest": { + "index": "reindex-dest" + } + } + """.trimIndent(), + ContentType.APPLICATION_JSON + ) + ) + return response + } }