Skip to content

Commit

Permalink
[Uptime] Unskip alerting functional tests (elastic#72963) (elastic#73954
Browse files Browse the repository at this point in the history
)

* Unskip monitor status alert test.

* Trying to resolve flakiness.

* Remove commented code.

* Simplify test expect.

* Revert conditional block change.

* Remove line in question.

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
justinkambic and elasticmachine authored Jul 31, 2020
1 parent c5a5840 commit fefbbd5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion x-pack/test/functional/services/uptime/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function UptimeNavigationProvider({ getService, getPageObjects }: FtrProv
if (await testSubjects.exists('uptimeSettingsToOverviewLink', { timeout: 0 })) {
await testSubjects.click('uptimeSettingsToOverviewLink');
await testSubjects.existOrFail('uptimeOverviewPage', { timeout: 2000 });
} else if (!(await testSubjects.exists('uptimeOverviewPage', { timeout: 0 }))) {
} else {
await PageObjects.common.navigateToApp('uptime');
await PageObjects.header.waitUntilLoadingHasFinished();
await testSubjects.existOrFail('uptimeOverviewPage', { timeout: 2000 });
Expand Down
17 changes: 6 additions & 11 deletions x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default ({ getPageObjects, getService }: FtrProviderContext) => {
// FLAKY: https://github.com/elastic/kibana/issues/65948
describe.skip('uptime alerts', () => {
describe('uptime alerts', () => {
const pageObjects = getPageObjects(['common', 'uptime']);
const supertest = getService('supertest');
const retry = getService('retry');
Expand Down Expand Up @@ -105,7 +104,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
alertTypeId,
consumer,
id,
params: { numTimes, timerange, locations, filters },
params: { numTimes, timerangeUnit, timerangeCount, filters },
schedule: { interval },
tags,
} = alert;
Expand All @@ -119,14 +118,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
expect(interval).to.eql('11m');
expect(tags).to.eql(['uptime', 'another']);
expect(numTimes).to.be(3);
expect(timerange.from).to.be('now-1h');
expect(timerange.to).to.be('now');
expect(locations).to.eql(['mpls']);
expect(filters).to.eql(
'{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"monitor.id":"0001-up"}}],' +
'"minimum_should_match":1}},{"bool":{"filter":[{"bool":{"should":[{"match":{"observer.geo.name":"mpls"}}],' +
'"minimum_should_match":1}},{"bool":{"filter":[{"bool":{"should":[{"match":{"url.port":5678}}],' +
'"minimum_should_match":1}},{"bool":{"should":[{"match":{"monitor.type":"http"}}],"minimum_should_match":1}}]}}]}}]}}'
expect(timerangeUnit).to.be('h');
expect(timerangeCount).to.be(1);
expect(JSON.stringify(filters)).to.eql(
`{"url.port":["5678"],"observer.geo.name":["mpls"],"monitor.type":["http"],"tags":[]}`
);
} finally {
await supertest.delete(`/api/alerts/alert/${id}`).set('kbn-xsrf', 'true').expect(204);
Expand Down

0 comments on commit fefbbd5

Please sign in to comment.