Skip to content

Commit

Permalink
[Entity Analytics] Allow transfrom state to be "indexing" in risk eng…
Browse files Browse the repository at this point in the history
…ine test (#193789)

Closes #193709

We are testing that the transform is successfully started, we have had a
test fail because the transform is in state 'indexing' which is another
healthy state indicating the transform is started and healthy.
  • Loading branch information
hop-dev authored Sep 24, 2024
1 parent 913b6fe commit dcff283
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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', () => {
Expand Down

0 comments on commit dcff283

Please sign in to comment.