From 08e5b75f5c305631019b7bcfa68e8ae24b85e659 Mon Sep 17 00:00:00 2001 From: mohamedhamed-ahmed Date: Mon, 11 Nov 2024 15:38:39 +0100 Subject: [PATCH 1/2] [Dataset Quality] Fix timeout with privileges test --- .../dataset_quality_privileges.ts | 20 ++++++++++--------- 1 file changed, 11 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..2b490190e8560 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,7 @@ 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 +145,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 () => { From a46ca349a10dfafa26855c919911136391f2b7bd Mon Sep 17 00:00:00 2001 From: mohamedhamed-ahmed Date: Mon, 11 Nov 2024 15:42:09 +0100 Subject: [PATCH 2/2] [Dataset Quality] Fix privileges test timeout --- .../apps/dataset_quality/dataset_quality_privileges.ts | 1 + 1 file changed, 1 insertion(+) 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 2b490190e8560..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 @@ -21,6 +21,7 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid 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';