diff --git a/x-pack/test/alerting_api_integration/common/plugins/alerts/server/rule_types.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/rule_types.ts index 6c16c694bc9e9..a3f0f39e908ed 100644 --- a/x-pack/test/alerting_api_integration/common/plugins/alerts/server/rule_types.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/alerts/server/rule_types.ts @@ -750,6 +750,9 @@ function getPatternFiringAutoRecoverFalseRuleType() { } else if (scheduleByPattern === 'timeout') { // delay longer than the timeout await new Promise((r) => setTimeout(r, 12000)); + } else if (scheduleByPattern === 'run_long') { + // delay so rule runs a little longer + await new Promise((r) => setTimeout(r, 4000)); } else { services.alertFactory.create(instanceId).scheduleActions('default', scheduleByPattern); } diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/find.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/find.ts index 14ec909ea872d..61df6247b18bb 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/find.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/find.ts @@ -17,8 +17,7 @@ export default function findBackfillTests({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const supertestWithoutAuth = getService('supertestWithoutAuth'); - // Failing: See https://github.com/elastic/kibana/issues/196226 - describe.skip('find backfill', () => { + describe('find backfill', () => { let backfillIds: Array<{ id: string; spaceId: string }> = []; const objectRemover = new ObjectRemover(supertest); const start1 = moment().utc().startOf('day').subtract(14, 'days').toISOString(); @@ -279,15 +278,12 @@ export default function findBackfillTests({ getService }: FtrProviderContext) { .auth(apiOptions.username, apiOptions.password); // find backfill with end time that is after one backfill ends + const findEnd = moment(end2).utc().add(1, 'hour').toISOString(); const findWithEndOneRuleResponse = await supertestWithoutAuth .post( `${getUrlPrefix( apiOptions.spaceId - )}/internal/alerting/rules/backfill/_find?end=${moment() - .utc() - .startOf('day') - .subtract(9, 'days') - .toISOString()}` + )}/internal/alerting/rules/backfill/_find?end=${findEnd}` ) .set('kbn-xsrf', 'foo') .auth(apiOptions.username, apiOptions.password); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/schedule.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/schedule.ts index 9d7b79d6cbce0..ab4734239ce0d 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/schedule.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/schedule.ts @@ -63,7 +63,7 @@ export default function scheduleBackfillTests({ getService }: FtrProviderContext rule_type_id: 'test.patternFiringAutoRecoverFalse', params: { pattern: { - instance: [true, false, true], + instance: ['run_long', 'run_long', 'run_long'], }, }, schedule: { interval: '12h' }, @@ -85,7 +85,7 @@ export default function scheduleBackfillTests({ getService }: FtrProviderContext expect(result.rule.tags).to.eql(['foo']); expect(result.rule.params).to.eql({ pattern: { - instance: [true, false, true], + instance: ['run_long', 'run_long', 'run_long'], }, }); expect(result.rule.enabled).to.eql(true); @@ -103,7 +103,7 @@ export default function scheduleBackfillTests({ getService }: FtrProviderContext expect(result.rule.tags).to.eql(['foo']); expect(result.rule.params).to.eql({ pattern: { - instance: [true, false, true], + instance: ['run_long', 'run_long', 'run_long'], }, }); expect(result.rule.enabled).to.eql(true);