From 1b0970ccce2758a4635a60b1fa03b05f736ba62a Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 12 Nov 2024 05:20:19 +1100 Subject: [PATCH] [8.16] [Dataset Quality] Fix privileges test timeout (#199657) (#199669) # Backport This will backport the following commits from `main` to `8.16`: - [[Dataset Quality] Fix privileges test timeout (#199657)](https://github.com/elastic/kibana/pull/199657) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: mohamedhamed-ahmed --- .../dataset_quality_privileges.ts | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/x-pack/test/functional/apps/dataset_quality/dataset_quality_privileges.ts b/x-pack/test/functional/apps/dataset_quality/dataset_quality_privileges.ts index e196f92c1cf18..48d7216c33d59 100644 --- a/x-pack/test/functional/apps/dataset_quality/dataset_quality_privileges.ts +++ b/x-pack/test/functional/apps/dataset_quality/dataset_quality_privileges.ts @@ -20,6 +20,8 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid const security = getService('security'); const synthtrace = getService('logSynthtraceEsClient'); const testSubjects = getService('testSubjects'); + const retry = getService('retry'); + const to = new Date(new Date().setDate(new Date().getDate() - 1)).toISOString(); const apacheAccessDatasetName = 'apache.access'; @@ -144,15 +146,16 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid const datasetWithMonitorPrivilege = apacheAccessDatasetHumanName; const datasetWithoutMonitorPrivilege = 'synth.1'; - // "Size" should be available for `apacheAccessDatasetName` - await testSubjects.missingOrFail( - `${PageObjects.datasetQuality.testSubjectSelectors.datasetQualityInsufficientPrivileges}-sizeBytes-${datasetWithMonitorPrivilege}` - ); - - // "Size" should not be available for `datasetWithoutMonitorPrivilege` - await testSubjects.existOrFail( - `${PageObjects.datasetQuality.testSubjectSelectors.datasetQualityInsufficientPrivileges}-sizeBytes-${datasetWithoutMonitorPrivilege}` - ); + await retry.tryForTime(5000, async () => { + // "Size" should be available for `apacheAccessDatasetName` + await testSubjects.missingOrFail( + `${PageObjects.datasetQuality.testSubjectSelectors.datasetQualityInsufficientPrivileges}-sizeBytes-${datasetWithMonitorPrivilege}` + ); + // "Size" should not be available for `datasetWithoutMonitorPrivilege` + await testSubjects.existOrFail( + `${PageObjects.datasetQuality.testSubjectSelectors.datasetQualityInsufficientPrivileges}-sizeBytes-${datasetWithoutMonitorPrivilege}` + ); + }); }); it('Details page shows insufficient privileges warning for underprivileged data stream', async () => {