Skip to content

Commit

Permalink
fixed flaky test (elastic#57490)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Feb 12, 2020
1 parent 3194cd0 commit bf894f6
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 bf894f6

Please sign in to comment.