update_engine: Do not ignore backoff on test/dev images
Currently we need to automatically try to test backoff scenarios, but the
backoff is disabled by default on test/dev images. This patch adds a check for a
new preference 'no-ignore-backoff' if the image was a non-official build. If the
preference does not exist, the default behavior is achieved, otherwise the
backoff is not being ignored.
BUG=chromium:825065
TEST=unittest
Change-Id: I2fca7e343479274fc9125407d27a4ae84d543641
Reviewed-on: https://chromium-review.googlesource.com/988296
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: David Haddock <dhaddock@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/payload_state.cc b/payload_state.cc
index 6689cf4..a393b91 100644
--- a/payload_state.cc
+++ b/payload_state.cc
@@ -408,9 +408,11 @@
}
}
- if (!system_state_->hardware()->IsOfficialBuild()) {
+ if (!system_state_->hardware()->IsOfficialBuild() &&
+ !prefs_->Exists(kPrefsNoIgnoreBackoff)) {
// Backoffs are needed only for official builds. We do not want any delays
- // or update failures due to backoffs during testing or development.
+ // or update failures due to backoffs during testing or development. Unless
+ // the |kPrefsNoIgnoreBackoff| is manually set.
LOG(INFO) << "No backoffs for test/dev images. "
<< "Can proceed with the download";
return false;