From d259d4f6b15a4df619fa83995742d3cd015d5122 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Tue, 13 Aug 2024 17:29:48 +0200 Subject: [PATCH] [Synthetics] Unskip get too many monitors test !! (#190404) ## Summary Fixes https://github.com/elastic/kibana/issues/169753 !! Flaky test runner https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6753 --- .../apis/synthetics/get_monitor.ts | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) 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 () => {