diff --git a/src/platform/test/functional/apps/discover/group1/_discover_histogram.ts b/src/platform/test/functional/apps/discover/group1/_discover_histogram.ts index a72f299b4d125..196dac852871c 100644 --- a/src/platform/test/functional/apps/discover/group1/_discover_histogram.ts +++ b/src/platform/test/functional/apps/discover/group1/_discover_histogram.ts @@ -309,24 +309,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await discover.saveSearch(savedSearch); await discover.chooseBreakdownField('extension.keyword'); await discover.setChartInterval('Second'); - let requestData = - (await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? ''; - expect(JSON.parse(requestData)).to.eql({ - dataViewId: 'long-window-logstash-*', - timeField: '@timestamp', - timeInterval: 's', - breakdownField: 'extension.keyword', + await retry.try(async () => { + const requestData = + (await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? ''; + expect(JSON.parse(requestData)).to.eql({ + dataViewId: 'long-window-logstash-*', + timeField: '@timestamp', + timeInterval: 's', + breakdownField: 'extension.keyword', + }); }); await discover.toggleChartVisibility(); await discover.waitUntilSearchingHasFinished(); await discover.revertUnsavedChanges(); await discover.waitUntilSearchingHasFinished(); - requestData = - (await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? ''; - expect(JSON.parse(requestData)).to.eql({ - dataViewId: 'long-window-logstash-*', - timeField: '@timestamp', - timeInterval: 'auto', + await retry.try(async () => { + const requestData = + (await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? ''; + expect(JSON.parse(requestData)).to.eql({ + dataViewId: 'long-window-logstash-*', + timeField: '@timestamp', + timeInterval: 'auto', + }); }); }); }); diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group1/_discover_histogram.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group1/_discover_histogram.ts index 3be4162386308..f512583d8db06 100644 --- a/x-pack/test_serverless/functional/test_suites/common/discover/group1/_discover_histogram.ts +++ b/x-pack/test_serverless/functional/test_suites/common/discover/group1/_discover_histogram.ts @@ -316,24 +316,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.saveSearch(savedSearch); await PageObjects.discover.chooseBreakdownField('extension.keyword'); await PageObjects.discover.setChartInterval('Second'); - let requestData = - (await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? ''; - expect(JSON.parse(requestData)).to.eql({ - dataViewId: 'long-window-logstash-*', - timeField: '@timestamp', - timeInterval: 's', - breakdownField: 'extension.keyword', + await retry.try(async () => { + const requestData = + (await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? ''; + expect(JSON.parse(requestData)).to.eql({ + dataViewId: 'long-window-logstash-*', + timeField: '@timestamp', + timeInterval: 's', + breakdownField: 'extension.keyword', + }); }); await PageObjects.discover.toggleChartVisibility(); await PageObjects.discover.waitUntilSearchingHasFinished(); await PageObjects.discover.revertUnsavedChanges(); await PageObjects.discover.waitUntilSearchingHasFinished(); - requestData = - (await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? ''; - expect(JSON.parse(requestData)).to.eql({ - dataViewId: 'long-window-logstash-*', - timeField: '@timestamp', - timeInterval: 'auto', + await retry.try(async () => { + const requestData = + (await testSubjects.getAttribute('unifiedHistogramChart', 'data-request-data')) ?? ''; + expect(JSON.parse(requestData)).to.eql({ + dataViewId: 'long-window-logstash-*', + timeField: '@timestamp', + timeInterval: 'auto', + }); }); }); });