From b8fcdcc933fb6637294c03f285d6b8eb7df7b507 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:14:09 +1100 Subject: [PATCH] [8.x] [Entity Analytics] Allow task status to be "claiming" in disable/enable test (#196172) (#196454) # Backport This will backport the following commits from `main` to `8.x`: - [[Entity Analytics] Allow task status to be "claiming" in disable/enable test (#196172)](https://github.com/elastic/kibana/pull/196172) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Mark Hopkin --- .../init_and_status_apis.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts index bd3493b82d348..f0b966c1c166e 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts @@ -19,6 +19,10 @@ import { } from '../../utils'; import { FtrProviderContext } from '../../../../ftr_provider_context'; +const expectTaskIsNotRunning = (taskStatus?: string) => { + expect(['idle', 'claiming']).contain(taskStatus); +}; + export default ({ getService }: FtrProviderContext) => { const es = getService('es'); const supertest = getService('supertest'); @@ -356,7 +360,7 @@ export default ({ getService }: FtrProviderContext) => { expect(status2.body.legacy_risk_engine_status).to.be('NOT_INSTALLED'); expect(status2.body.risk_engine_task_status?.runAt).to.be.a('string'); - expect(status2.body.risk_engine_task_status?.status).to.be('idle'); + expectTaskIsNotRunning(status2.body.risk_engine_task_status?.status); expect(status2.body.risk_engine_task_status?.startedAt).to.be(undefined); await riskEngineRoutes.disable(); @@ -374,7 +378,7 @@ export default ({ getService }: FtrProviderContext) => { expect(status4.body.legacy_risk_engine_status).to.be('NOT_INSTALLED'); expect(status4.body.risk_engine_task_status?.runAt).to.be.a('string'); - expect(status4.body.risk_engine_task_status?.status).to.be('idle'); + expectTaskIsNotRunning(status4.body.risk_engine_task_status?.status); expect(status4.body.risk_engine_task_status?.startedAt).to.be(undefined); }); @@ -395,7 +399,7 @@ export default ({ getService }: FtrProviderContext) => { expect(status2.body.legacy_risk_engine_status).to.be('NOT_INSTALLED'); expect(status2.body.risk_engine_task_status?.runAt).to.be.a('string'); - expect(status2.body.risk_engine_task_status?.status).to.be('idle'); + expectTaskIsNotRunning(status2.body.risk_engine_task_status?.status); expect(status2.body.risk_engine_task_status?.startedAt).to.be(undefined); }); });