Bug 949695 tests followup - fix test_handleSyncError to reset error account so it passes when run twice

This commit is contained in:
Mark Hammond 2013-12-20 15:57:26 +11:00
parent 98088300d6
commit e635bc3f8e

View File

@ -407,7 +407,15 @@ add_identity_test(this, function test_handleSyncError() {
do_check_true(Status.enforceBackoff);
scheduler.syncTimer.clear();
yield cleanUpAndGo(server);
_("Arrange for a successful sync to reset the scheduler error count");
let deferred = Promise.defer();
Svc.Obs.add("weave:service:sync:finish", function onSyncFinish() {
Svc.Obs.remove("weave:service:sync:finish", onSyncFinish);
cleanUpAndGo(server).then(deferred.resolve);
});
Svc.Prefs.set("firstSync", "wipeRemote");
scheduler.scheduleNextSync(-1);
yield deferred.promise;
});
add_identity_test(this, function test_client_sync_finish_updateClientMode() {