From e0542f903ad767e4990b3775f6d1dd68aa3d2b34 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 14 Oct 2020 11:54:39 -0400 Subject: [PATCH] tests: Tune `waitForPromise()` poll count test This should have been done in c222fc5d0b8e1058ebfae93fb95aae9f56b6eeea but I forgot. --- tests/frontend/specs/helper.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/frontend/specs/helper.js b/tests/frontend/specs/helper.js index 9d0914013..409982596 100644 --- a/tests/frontend/specs/helper.js +++ b/tests/frontend/specs/helper.js @@ -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); }); });