diff --git a/x-pack/test/api_integration/apis/synthetics/get_monitor.ts b/x-pack/test/api_integration/apis/synthetics/get_monitor.ts index 41c299b4ed3ca..98fbefd89acc2 100644 --- a/x-pack/test/api_integration/apis/synthetics/get_monitor.ts +++ b/x-pack/test/api_integration/apis/synthetics/get_monitor.ts @@ -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[]; @@ -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)); @@ -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 () => {