Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed alerts ui test timeout issue, related to the multiple server calls for delete all alerts, by reducing the number of alerts to the two and increasing retry timeout. #81067

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const namePrefix = generateUniqueKey();
let count = 0;
const createdAlertsFirstPage = await Promise.all(
times(10, () => createAlert({ name: `${namePrefix}-0${count++}` }))
);

const createdAlertsSecondPage = await Promise.all(
times(2, () => createAlert({ name: `${namePrefix}-1${count++}` }))
times(2, () => createAlert({ name: `${namePrefix}-0${count++}` }))
);

await pageObjects.triggersActionsUI.searchAlerts(namePrefix);
Expand All @@ -442,18 +438,14 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await testSubjects.click('deleteIdsConfirmation > confirmModalConfirmButton');
await testSubjects.missingOrFail('deleteIdsConfirmation');

await retry.try(async () => {
await retry.tryForTime(30000, async () => {
const toastTitle = await pageObjects.common.closeToast();
expect(toastTitle).to.eql('Deleted 10 alerts');
expect(toastTitle).to.eql('Deleted 2 alerts');
});

await pageObjects.triggersActionsUI.searchAlerts(namePrefix);
const searchResultsAfterDelete = await pageObjects.triggersActionsUI.getAlertsList();
expect(searchResultsAfterDelete).to.have.length(2);
expect(searchResultsAfterDelete[0].name).to.eql(createdAlertsSecondPage[0].name);
expect(searchResultsAfterDelete[1].name).to.eql(createdAlertsSecondPage[1].name);

await deleteAlerts([createdAlertsSecondPage[0].id, createdAlertsSecondPage[1].id]);
expect(searchResultsAfterDelete).to.have.length(0);
});
});
};