Skip to content

Commit

Permalink
[8.x] [Dataset Quality] Fix privileges test timeout (#199657) (#199670)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dataset Quality] Fix privileges test timeout
(#199657)](#199657)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"mohamedhamed-ahmed","email":"mohamed.ahmed@elastic.co"},"sourceCommit":{"committedDate":"2024-11-11T16:30:52Z","message":"[Dataset
Quality] Fix privileges test timeout (#199657)\n\ncloses
https://github.com/elastic/kibana/issues/198865","sha":"53314895c268ffe5ab2a5c4c7f603e2e554471b8","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-logs","v8.16.0","backport:version","v8.17.0"],"title":"[Dataset
Quality] Fix privileges test
timeout","number":199657,"url":"https://github.com/elastic/kibana/pull/199657","mergeCommit":{"message":"[Dataset
Quality] Fix privileges test timeout (#199657)\n\ncloses
https://github.com/elastic/kibana/issues/198865","sha":"53314895c268ffe5ab2a5c4c7f603e2e554471b8"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199657","number":199657,"mergeCommit":{"message":"[Dataset
Quality] Fix privileges test timeout (#199657)\n\ncloses
https://github.com/elastic/kibana/issues/198865","sha":"53314895c268ffe5ab2a5c4c7f603e2e554471b8"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: mohamedhamed-ahmed <mohamed.ahmed@elastic.co>
  • Loading branch information
kibanamachine and mohamedhamed-ahmed authored Nov 11, 2024
1 parent 5d8a7d6 commit 07e8e5c
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 07e8e5c

Please sign in to comment.