Skip to content

Commit

Permalink
[RAM] Fix Failing test: X-Pack Alerting API Integration Tests - Alert…
Browse files Browse the repository at this point in the history
…ing - group1.x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/get_alert_summary·ts (#164759)

## Summary

Fix: #156792


https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2987
  • Loading branch information
XavierM authored Aug 24, 2023
1 parent 8e66122 commit 6c2cd60
Showing 1 changed file with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export default function createGetAlertSummaryTests({ getService }: FtrProviderCo
const retry = getService('retry');
const alertUtils = new AlertUtils({ space: Spaces.space1, supertestWithoutAuth });

// FLAKY: https://github.com/elastic/kibana/issues/156792
describe.skip('getAlertSummary', () => {
describe('getAlertSummary', () => {
const objectRemover = new ObjectRemover(supertest);

afterEach(() => objectRemover.removeAll());
Expand Down Expand Up @@ -272,6 +271,26 @@ export default function createGetAlertSummaryTests({ getService }: FtrProviderCo
});

it('handles multi-alert status during maintenance window', async () => {
const { body: createdMaintenanceWindow } = await supertest
.post(`${getUrlPrefix(Spaces.space1.id)}/internal/alerting/rules/maintenance_window`)
.set('kbn-xsrf', 'foo')
.send({
title: 'test-maintenance-window',
duration: 60 * 60 * 1000, // 1 hr
r_rule: {
dtstart: new Date().toISOString(),
tzid: 'UTC',
freq: 2, // weekly
},
});
objectRemover.add(
Spaces.space1.id,
createdMaintenanceWindow.id,
'rules/maintenance_window',
'alerting',
true
);

// pattern of when the rule should fire
const pattern = {
alertA: [true, true, true, true],
Expand All @@ -293,27 +312,6 @@ export default function createGetAlertSummaryTests({ getService }: FtrProviderCo

objectRemover.add(Spaces.space1.id, createdRule.id, 'rule', 'alerting');

const { body: createdMaintenanceWindow } = await supertest
.post(`${getUrlPrefix(Spaces.space1.id)}/internal/alerting/rules/maintenance_window`)
.set('kbn-xsrf', 'foo')
.send({
title: 'test-maintenance-window',
duration: 60 * 60 * 1000, // 1 hr
r_rule: {
dtstart: new Date().toISOString(),
tzid: 'UTC',
freq: 2, // weekly
},
});

objectRemover.add(
Spaces.space1.id,
createdMaintenanceWindow.id,
'rules/maintenance_window',
'alerting',
true
);

await alertUtils.muteInstance(createdRule.id, 'alertC');
await alertUtils.muteInstance(createdRule.id, 'alertD');
await waitForEvents(createdRule.id, ['new-instance', 'recovered-instance']);
Expand Down

0 comments on commit 6c2cd60

Please sign in to comment.