Propagate timeout errors in autoupdate_PeriodicCheck to server test.
Currently if it fails with a TimeoutError, the server test will not show
this as a reason for the failure (including in stainless). So catch the
error and raise TestFail instead.
BUG=chromium:1134808
TEST=autoupdate_Periodic
Change-Id: I3eb32d40e1642f897bd910577e693013a133f27c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2505505
Tested-by: David Haddock <dhaddock@chromium.org>
Auto-Submit: David Haddock <dhaddock@chromium.org>
Reviewed-by: Kyle Shimabukuro <kyleshima@chromium.org>
Commit-Queue: Kyle Shimabukuro <kyleshima@chromium.org>
diff --git a/client/site_tests/autoupdate_PeriodicCheck/autoupdate_PeriodicCheck.py b/client/site_tests/autoupdate_PeriodicCheck/autoupdate_PeriodicCheck.py
index 147caec..c0251ad 100644
--- a/client/site_tests/autoupdate_PeriodicCheck/autoupdate_PeriodicCheck.py
+++ b/client/site_tests/autoupdate_PeriodicCheck/autoupdate_PeriodicCheck.py
@@ -6,6 +6,7 @@
import os
from autotest_lib.client.bin import utils
+from autotest_lib.client.common_lib import error
from autotest_lib.client.cros.update_engine import nebraska_wrapper
from autotest_lib.client.cros.update_engine import update_engine_test
@@ -47,10 +48,13 @@
self._restart_update_engine()
# Wait for the first update check.
- utils.poll_for_condition(
+ try:
+ utils.poll_for_condition(
lambda: len(self._get_update_requests()) == 1,
desc='1st periodic update check.',
timeout=1.5 * periodic_interval)
+ except utils.TimeoutError:
+ raise error.TestFail('1st periodic check not found.')
self._check_update_engine_log_for_entry(self._PERIODIC_LOG,
raise_error=True)
logging.info('First periodic update was initiated.')
@@ -59,9 +63,12 @@
self._create_custom_lsb_release(nebraska.get_update_url())
# Wait for the second update check.
- utils.poll_for_condition(
+ try:
+ utils.poll_for_condition(
lambda: len(self._get_update_requests()) == 2,
desc='2nd periodic update check.',
- timeout=1.5 * periodic_interval)
+ timeout=2 * periodic_interval)
+ except utils.TimeoutError:
+ raise error.TestFail('2nd periodic check not found.')
logging.info('Second periodic update was initiated.')
self._wait_for_update_to_complete()