Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Entity Analytics] Allow task status to be "claiming" in disable/enable test #196172

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import {
} from '../../utils';
import { FtrProviderContext } from '../../../../ftr_provider_context';

const expectTaskIsNotRunning = (taskStatus: any) => {
expect(['idle', 'claiming']).contain(taskStatus);
};

export default ({ getService }: FtrProviderContext) => {
const es = getService('es');
const supertest = getService('supertest');
Expand Down Expand Up @@ -355,7 +359,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();
Expand All @@ -373,7 +377,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);
});

Expand All @@ -394,7 +398,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);
});
});
Expand Down