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

Fixing flaky ml test #183139

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ import { TRANSFORM_HEALTH_RESULTS } from '@kbn/transform-plugin/common/constants
import { FtrProviderContext } from '../../../../../../common/ftr_provider_context';
import { getUrlPrefix, ObjectRemover } from '../../../../../../common/lib';
import { Spaces } from '../../../../../scenarios';
import { runSoon } from '../../../group3/test_helpers';

const CONNECTOR_TYPE_ID = '.index';
const RULE_TYPE_ID = 'transform_health';
const ES_TEST_INDEX_SOURCE = 'transform-alert:transform-health';
const ES_TEST_INDEX_REFERENCE = '-na-';
const ES_TEST_OUTPUT_INDEX_NAME = `${ES_TEST_INDEX_NAME}-ts-output`;

const RULE_INTERVAL_SECONDS = 10000;

interface CreateRuleParams {
name: string;
includeTransforms: string[];
Expand Down Expand Up @@ -114,15 +111,13 @@ export default function ruleTests({ getService }: FtrProviderContext) {
});

it('runs correctly', async () => {
await stopTransform(transformId);

const ruleId = await createRule({
name: 'Test all transforms',
includeTransforms: ['*'],
});

await stopTransform(transformId);

await runSoon({ id: ruleId, supertest, retry });

log.debug('Checking created alerts...');

const docs = await waitForDocs(1);
Expand Down Expand Up @@ -196,7 +191,7 @@ export default function ruleTests({ getService }: FtrProviderContext) {
consumer: 'alerts',
enabled: true,
rule_type_id: RULE_TYPE_ID,
schedule: { interval: `${RULE_INTERVAL_SECONDS}s` },
schedule: { interval: '1d' },
actions: [action],
notify_when: 'onActiveAlert',
params: {
Expand Down