autotest: Increase attempts to download stable image after every 10th attempt


BUG=b:172886823
TEST=run local

Change-Id: I23692158f8a05f284b671e58b38f0a443f550be5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2599218
Tested-by: Otabek Kasimov <otabek@google.com>
Reviewed-by: Garry Wang <xianuowang@chromium.org>
Commit-Queue: Otabek Kasimov <otabek@google.com>
diff --git a/server/hosts/cros_repair.py b/server/hosts/cros_repair.py
index 9545ef4..671ff72 100644
--- a/server/hosts/cros_repair.py
+++ b/server/hosts/cros_repair.py
@@ -1097,9 +1097,12 @@
         if not need_update_image and host.health_profile:
             repair_failed_count = host.health_profile.get_repair_fail_count()
             # try to re-image USB when previous attempt failed
-            if repair_failed_count == 1:
-                logging.info('Required re-download image to usbkey as'
-                             ' a previous repair failed.')
+            if (repair_failed_count > 0 and
+                (repair_failed_count == 1 or repair_failed_count % 10 == 0)):
+                logging.info(
+                        'Required re-download image to usbkey as'
+                        ' a previous repair failed. Fail count: %s',
+                        repair_failed_count)
                 need_update_image = True
 
         update_url = None