From 1ec49c9628f40d81bf7da199dca4ca1602a54edd Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Thu, 9 Jan 2025 06:35:40 +0100 Subject: [PATCH] [Discover] Unskip functional discover request counts test and skip ES|QL part (#205690) Unskipping the main test, and unskipping the `ES|QL` part due to flakiness --- .../apps/discover/group3/_request_counts.ts | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/test/functional/apps/discover/group3/_request_counts.ts b/test/functional/apps/discover/group3/_request_counts.ts index fd100513b9d87..4be360f5a7e8c 100644 --- a/test/functional/apps/discover/group3/_request_counts.ts +++ b/test/functional/apps/discover/group3/_request_counts.ts @@ -28,8 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const log = getService('log'); const retry = getService('retry'); - // Failing: See https://github.com/elastic/kibana/issues/205344 - describe.skip('discover request counts', function describeIndexTests() { + describe('discover request counts', function describeIndexTests() { before(async function () { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); @@ -54,30 +53,34 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); const expectSearchCount = async (type: 'ese' | 'esql', searchCount: number) => { - await retry.try(async () => { - if (searchCount === 0) { - await browser.execute(async () => { - performance.clearResourceTimings(); - }); - } - await waitForLoadingToFinish(); - const endpoint = type === 'esql' ? `${type}_async` : type; - const requests = await browser.execute(() => - performance - .getEntries() - .filter((entry: any) => ['fetch', 'xmlhttprequest'].includes(entry.initiatorType)) - ); + await retry.tryWithRetries( + `expect ${type} request to match count ${searchCount}`, + async () => { + if (searchCount === 0) { + await browser.execute(async () => { + performance.clearResourceTimings(); + }); + } + await waitForLoadingToFinish(); + const endpoint = type === 'esql' ? `${type}_async` : type; + const requests = await browser.execute(() => + performance + .getEntries() + .filter((entry: any) => ['fetch', 'xmlhttprequest'].includes(entry.initiatorType)) + ); - const result = requests.filter((entry) => - entry.name.endsWith(`/internal/search/${endpoint}`) - ); + const result = requests.filter((entry) => + entry.name.endsWith(`/internal/search/${endpoint}`) + ); - const count = result.length; - if (count !== searchCount) { - log.warning('Request count differs:', result); - } - expect(count).to.be(searchCount); - }); + const count = result.length; + if (count !== searchCount) { + log.warning('Request count differs:', result); + } + expect(count).to.be(searchCount); + }, + { retryCount: 5, retryDelay: 500 } + ); }; const waitForLoadingToFinish = async () => { @@ -257,8 +260,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); }); - - describe('ES|QL mode', () => { + // Currently ES|QL checks are disabled due to various flakiness + // Note that ES|QL also checks for different number of requests due to the fields request triggered + // by the ES|QL Editor + describe.skip('ES|QL mode', () => { const type = 'esql'; before(async () => { await common.navigateToApp('discover');