Skip to content

Commit

Permalink
fixed flaky test (elastic#57490) (elastic#57500)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
gmmorris and elasticmachine committed Feb 13, 2020
1 parent 8159718 commit f75c10f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
})
)
.forEach(alertInstanceDuration => {
// make sure the duration is within a 2 second range
// make sure the duration is within a 10 second range which is
// good enough as the alert interval is 1m, so we know it is a fresh value
expect(alertInstanceDuration.as('milliseconds')).to.greaterThan(
durationFromInstanceTillPageLoad.subtract(1000 * 2).as('milliseconds')
durationFromInstanceTillPageLoad.subtract(1000 * 10).as('milliseconds')
);
expect(alertInstanceDuration.as('milliseconds')).to.lessThan(
durationFromInstanceTillPageLoad.add(1000 * 2).as('milliseconds')
durationFromInstanceTillPageLoad.add(1000 * 10).as('milliseconds')
);
});
});
Expand Down

0 comments on commit f75c10f

Please sign in to comment.