From 94bb21e33bc3e4ba27586006f97a893b17f02e02 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 5 Dec 2023 13:25:41 -0700 Subject: [PATCH] [Alerting/API Tests] Add await to objectRemover.removeAll() (#172621) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Resolves an "unhandled Promise rejection" found for a CI failure for a PR: https://buildkite.com/elastic/kibana-pull-request/builds/181932#018c3b27-e511-4678-9e18-50f90e02c934 ``` 2023-12-05 19:03:36 UTC | Unhandled Promise rejection detected: -- | --   | 2023-12-05 19:03:36 UTC |     | 2023-12-05 19:03:36 UTC | Error: expected 204 "No Content", got 404 "Not Found"   | 2023-12-05 19:03:36 UTC | at map (object_remover.ts:44:12)   | 2023-12-05 19:03:36 UTC | at Array.map ()   | 2023-12-05 19:03:36 UTC | at ObjectRemover.removeAll (object_remover.ts:38:28)   | 2023-12-05 19:03:36 UTC | at Context.apply (max_queued_actions_circuit_breaker.ts:29:21)   | 2023-12-05 19:03:36 UTC | at Object.apply (wrap_function.js:73:30)   | 2023-12-05 19:03:36 UTC | at processTicksAndRejections (node:internal/process/task_queues:95:5) ``` --- .../tests/actions/max_queued_actions_circuit_breaker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/max_queued_actions_circuit_breaker.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/max_queued_actions_circuit_breaker.ts index 02231a58a83c3..f1bcafa3d84c3 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/max_queued_actions_circuit_breaker.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/max_queued_actions_circuit_breaker.ts @@ -26,7 +26,7 @@ export default function createActionTests({ getService }: FtrProviderContext) { }); afterEach(async () => { - objectRemover.removeAll(); + await objectRemover.removeAll(); await esTestIndexTool.destroy(); });