Skip to content

Commit

Permalink
[Uptime] Add timeout for slow process to skipped functional tests (#5…
Browse files Browse the repository at this point in the history
…6065) (#56135)

* Reorder assertions in functional tests.

* Introduce retry to functional tests.
  • Loading branch information
justinkambic committed Jan 28, 2020
1 parent e6ed777 commit b9e5b94
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions x-pack/test/functional/apps/uptime/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default ({ getPageObjects }: FtrProviderContext) => {
// TODO: add UI functional tests
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const pageObjects = getPageObjects(['uptime']);
const retry = getService('retry');

describe('overview page', function() {
const DEFAULT_DATE_START = 'Sep 10, 2019 @ 12:40:08.078';
Expand Down Expand Up @@ -84,16 +84,18 @@ export default ({ getPageObjects }: FtrProviderContext) => {
]);
});

// Flakey, see https://github.com/elastic/kibana/issues/54541
describe.skip('snapshot counts', () => {
describe('snapshot counts', () => {
it('updates the snapshot count when status filter is set to down', async () => {
await pageObjects.uptime.goToUptimePageAndSetDateRange(
DEFAULT_DATE_START,
DEFAULT_DATE_END
);
await pageObjects.uptime.setStatusFilter('down');
const counts = await pageObjects.uptime.getSnapshotCount();
expect(counts).to.eql({ up: '0', down: '7' });

await retry.tryForTime(12000, async () => {
const counts = await pageObjects.uptime.getSnapshotCount();
expect(counts).to.eql({ up: '0', down: '7' });
});
});

it('updates the snapshot count when status filter is set to up', async () => {
Expand All @@ -102,8 +104,10 @@ export default ({ getPageObjects }: FtrProviderContext) => {
DEFAULT_DATE_END
);
await pageObjects.uptime.setStatusFilter('up');
const counts = await pageObjects.uptime.getSnapshotCount();
expect(counts).to.eql({ up: '93', down: '0' });
await retry.tryForTime(12000, async () => {
const counts = await pageObjects.uptime.getSnapshotCount();
expect(counts).to.eql({ up: '93', down: '0' });
});
});
});
});
Expand Down

0 comments on commit b9e5b94

Please sign in to comment.