Skip to content

Commit

Permalink
[Synthetics] Unskip get too many monitors test !! (#190404)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 authored Aug 13, 2024
1 parent b85b1cb commit 386d290
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions x-pack/test/api_integration/apis/synthetics/get_monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function ({ getService }: FtrProviderContext) {

const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer');
const retry = getService('retry');

let _monitors: MonitorFields[];
let monitors: MonitorFields[];
Expand Down Expand Up @@ -59,8 +60,7 @@ export default function ({ getService }: FtrProviderContext) {
monitors = _monitors;
});

// FLAKY: https://github.com/elastic/kibana/issues/169753
describe.skip('get many monitors', () => {
describe('get many monitors', () => {
it('without params', async () => {
const [mon1, mon2] = await Promise.all(monitors.map(saveMonitor));

Expand Down Expand Up @@ -101,18 +101,20 @@ export default function ({ getService }: FtrProviderContext) {
.map(saveMonitor)
);

const firstPageResp = await supertest
.get(`${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=1&perPage=2`)
.expect(200);
const secondPageResp = await supertest
.get(`${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=2&perPage=3`)
.expect(200);
await retry.try(async () => {
const firstPageResp = await supertest
.get(`${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=1&perPage=2`)
.expect(200);
const secondPageResp = await supertest
.get(`${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=2&perPage=3`)
.expect(200);

expect(firstPageResp.body.total).greaterThan(6);
expect(firstPageResp.body.monitors.length).eql(2);
expect(secondPageResp.body.monitors.length).eql(3);
expect(firstPageResp.body.total).greaterThan(6);
expect(firstPageResp.body.monitors.length).eql(2);
expect(secondPageResp.body.monitors.length).eql(3);

expect(firstPageResp.body.monitors[0].id).not.eql(secondPageResp.body.monitors[0].id);
expect(firstPageResp.body.monitors[0].id).not.eql(secondPageResp.body.monitors[0].id);
});
});

it('with single monitorQueryId filter', async () => {
Expand Down

0 comments on commit 386d290

Please sign in to comment.