tests: Tune `waitForPromise()` poll count test

This should have been done in c222fc5d0b
but I forgot.
pull/4416/head
Richard Hansen 2020-10-14 11:54:39 -04:00 committed by John McLear
parent 3e14016214
commit e0542f903a
1 changed files with 4 additions and 2 deletions

View File

@ -238,8 +238,10 @@ describe("the test helper", function(){
await helper.waitForPromise(() => { checks++; return false; }, 2000, 100)
.catch(() => { rejected = true; });
expect(rejected).to.be(true);
expect(checks).to.be.greaterThan(15);
expect(checks).to.be.lessThan(21);
// One at the beginning, and 19-20 more depending on whether it's the timeout or the final
// poll that wins at 2000ms.
expect(checks).to.be.greaterThan(19);
expect(checks).to.be.lessThan(22);
});
});