From 772655ac53738cf1aa3805c67c51b21103219d87 Mon Sep 17 00:00:00 2001 From: Ying Mao Date: Wed, 4 Sep 2024 13:20:48 -0400 Subject: [PATCH] =?UTF-8?q?Fixes=20Failing=20test:=20X-Pack=20Alerting=20A?= =?UTF-8?q?PI=20Integration=20Tests.x-pack/test/alerting=5Fapi=5Fintegrati?= =?UTF-8?q?on/security=5Fand=5Fspaces/group1/tests/alerting/backfill/task?= =?UTF-8?q?=5Frunner=C2=B7ts=20-=20alerting=20api=20integration=20security?= =?UTF-8?q?=20and=20spaces=20enabled=20Alerts=20-=20Group=201=20alerts=20b?= =?UTF-8?q?ackfill=20rule=20runs=20ad=20hoc=20backfill=20task=20should=20r?= =?UTF-8?q?un=20all=20execution=20sets=20of=20a=20scheduled=20backfill=20a?= =?UTF-8?q?nd=20correctly=20generate=20alerts=20(#191761)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves https://github.com/elastic/kibana/issues/183350 ## Summary * Updated rule param that was causing a partial failure in the rule execution due to maxSignals being greater than the configured allowed max alerts * Updated tests to clean the alerts index after every test. After making these changes, was able to run the flaky test runner 4x200 times without failure. --------- Co-authored-by: Elastic Machine --- .../group1/tests/alerting/backfill/task_runner.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/task_runner.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/task_runner.ts index 66514e645e6d7..e66121a4c33db 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/task_runner.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/task_runner.ts @@ -86,22 +86,19 @@ export default function createBackfillTaskRunnerTests({ getService }: FtrProvide moment().utc().startOf('day').subtract(9, 'days').add(667, 'seconds').toISOString(), ]; - // FLAKY: https://github.com/elastic/kibana/issues/183350 - describe.skip('ad hoc backfill task', () => { + describe('ad hoc backfill task', () => { beforeEach(async () => { await esTestIndexTool.destroy(); await esTestIndexTool.setup(); }); afterEach(async () => { - await objectRemover.removeAll(); - await esTestIndexTool.destroy(); - }); - after(async () => { await es.deleteByQuery({ index: alertsAsDataIndex, query: { match_all: {} }, conflicts: 'proceed', }); + await objectRemover.removeAll(); + await esTestIndexTool.destroy(); }); // This test @@ -143,7 +140,7 @@ export default function createBackfillTaskRunnerTests({ getService }: FtrProvide from: '1m', kibana_siem_app_url: 'https://localhost:5601/app/security', }, - maxSignals: 100, + maxSignals: 20, riskScore: 21, riskScoreMapping: [], severity: 'low',