Bug 1346136 - Add more leeway in backoff testing. r?markh draft
authorEdouard Oger <eoger@fastmail.com>
Fri, 10 Mar 2017 15:39:41 -0500
changeset 496883 a8588d26199e4ae3652634c8090845bc00786221
parent 496768 a8d497b09753c91783b68c5805c64f34a2f39629
child 548735 8679eb59db5b7954b99dd883da75625285690b7c
push id48728
push userbmo:eoger@fastmail.com
push dateFri, 10 Mar 2017 20:40:10 +0000
reviewersmarkh
bugs1346136
milestone55.0a1
Bug 1346136 - Add more leeway in backoff testing. r?markh MozReview-Commit-ID: 4M86B9BVbq9
services/sync/tests/unit/test_syncscheduler.js
--- a/services/sync/tests/unit/test_syncscheduler.js
+++ b/services/sync/tests/unit/test_syncscheduler.js
@@ -834,19 +834,19 @@ add_task(async function test_sync_X_Weav
   // Sanity check that we picked the right value for BACKOFF:
   do_check_true(scheduler.syncInterval < BACKOFF * 1000);
 
   // Turn on server maintenance and sync again.
   serverBackoff = true;
   Service.sync();
 
   do_check_true(Status.backoffInterval >= BACKOFF * 1000);
-  // Allowing 3 seconds worth of of leeway between when Status.minimumNextSync
+  // Allowing 20 seconds worth of of leeway between when Status.minimumNextSync
   // was set and when this line gets executed.
-  let minimumExpectedDelay = (BACKOFF - 3) * 1000;
+  let minimumExpectedDelay = (BACKOFF - 20) * 1000;
   do_check_true(Status.minimumNextSync >= Date.now() + minimumExpectedDelay);
 
   // Verify that the next sync is actually going to wait that long.
   do_check_true(scheduler.nextSync >= Date.now() + minimumExpectedDelay);
   do_check_true(scheduler.syncTimer.delay >= minimumExpectedDelay);
 
   await cleanUpAndGo(server);
 });