Skip to content

Commit

Permalink
[RAM] Fix flaky expiring snooze test (reopen) (#159233)
Browse files Browse the repository at this point in the history
## Summary

Closes #159076

Wraps a flaky bit of test in retry.try

Second attempt to merge #159138 after that one inexplicably got its git
all in a twist or something

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
Zacqary and kibanamachine authored Jun 8, 2023
1 parent 4376704 commit 5bb0a05
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,19 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext

expect(response.statusCode).to.eql(204);
expect(response.body).to.eql('');
const { body: updatedAlert } = await supertestWithoutAuth
.get(`${getUrlPrefix(Spaces.space1.id)}/internal/alerting/rule/${createdRule.id}`)
.set('kbn-xsrf', 'foo')
.expect(200);
expect(updatedAlert.snooze_schedule).to.eql([
{
...SNOOZE_SCHEDULE,
duration: 1000,
},
]);

await retry.try(async () => {
const { body: updatedAlert } = await supertestWithoutAuth
.get(`${getUrlPrefix(Spaces.space1.id)}/internal/alerting/rule/${createdRule.id}`)
.set('kbn-xsrf', 'foo')
.expect(200);
expect(updatedAlert.snooze_schedule).to.eql([
{
...SNOOZE_SCHEDULE,
duration: 1000,
},
]);
});
log.info('wait for snoozing to end');
await retry.try(async () => {
const { body: alertWithExpiredSnooze } = await supertestWithoutAuth
Expand Down

0 comments on commit 5bb0a05

Please sign in to comment.