Skip to content

Commit

Permalink
Fixed alerts ui test timeout issue, related to the multiple server ca…
Browse files Browse the repository at this point in the history
…lls for delete all alerts, by reducing the number of alerts to the two and increasing retry timeout. (#81067)
  • Loading branch information
YulNaumenko authored Oct 20, 2020
1 parent caba25c commit ea7c255
Showing 1 changed file with 4 additions and 12 deletions.
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);
});
});
};

0 comments on commit ea7c255

Please sign in to comment.