From 69688608c458182917c2314a014468cd1cd444af Mon Sep 17 00:00:00 2001 From: mohamedhamed-ahmed Date: Mon, 11 Nov 2024 16:30:52 +0000 Subject: [PATCH] [Dataset Quality] Fix privileges test timeout (#199657) closes https://github.com/elastic/kibana/issues/198865 (cherry picked from commit 53314895c268ffe5ab2a5c4c7f603e2e554471b8) --- .../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 e196f92c1cf1..48d7216c33d5 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 () => {