From f39b04b09c7d8ab30e63cdde72799bf8eae5b714 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 25 Sep 2024 02:42:58 +1000 Subject: [PATCH] [8.x] [Entity Analytics] Allow transfrom state to be "indexing" in risk engine test (#193789) (#193892) # Backport This will backport the following commits from `main` to `8.x`: - [[Entity Analytics] Allow transfrom state to be "indexing" in risk engine test (#193789)](https://github.com/elastic/kibana/pull/193789) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Mark Hopkin --- .../risk_scoring_task/task_execution.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution.ts index a097c170de51c..7710a1f7045cd 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution.ts @@ -105,6 +105,9 @@ export default ({ getService }: FtrProviderContext): void => { }); it('@skipInServerlessMKI @skipInServerless starts the latest transform', async () => { + // Transform states that indicate the transform is running happily + const TRANSFORM_STARTED_STATES = ['started', 'indexing']; + await waitForRiskScoresToBePresent({ es, log, scoreCount: 10 }); const transformStats = await es.transform.getTransformStats({ @@ -113,12 +116,12 @@ export default ({ getService }: FtrProviderContext): void => { expect(transformStats.transforms.length).to.eql(1); const latestTransform = transformStats.transforms[0]; - if (latestTransform.state !== 'started') { - log.error('Transform state is not started, logging the transform'); + if (!TRANSFORM_STARTED_STATES.includes(latestTransform.state)) { + log.error('Transform state is not in the started states, logging the transform'); log.info(`latestTransform: ${JSON.stringify(latestTransform)}`); } - expect(latestTransform.state).to.eql('started'); + expect(TRANSFORM_STARTED_STATES).to.contain(latestTransform.state); }); describe('@skipInServerlessMKI disabling and re-enabling the risk engine', () => {