Skip to content

Commit

Permalink
[Dataset Quality] Fix privileges test timeout (elastic#199657)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedhamed-ahmed authored and CAWilson94 committed Nov 18, 2024
1 parent a90cea2 commit 0357980
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit 0357980

Please sign in to comment.