chromite: Move Timeout* functions to chromite.lib.timeout_util.
BUG=chromium:323675
CQ-DEPEND=CL:178733
TEST=cbuildbot --buildbot --debug --remote runs on x86-alex-paladin,
x86-mario-paladin, x86-mario-release
TEST=repo grep -E \
'cros_build_lib\.(Timeout|FatalTimeout|TimeoutDecorator|'\
'WaitForCondition|WaitForReturnValue|WaitForTreeStatus|'\
'IsTreeOpen|GetTreeStatus|SubCommandTimeout|Timeout|'\
'WaitForCondition|TreeOpen)'
TEST=all unit tests
Change-Id: Ida5b3b5be04a3b891da0f0c06db832d3d01be972
Reviewed-on: https://chromium-review.googlesource.com/178734
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
diff --git a/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index 232d63a..9101d70 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -40,6 +40,7 @@
from chromite.lib import parallel
from chromite.lib import remote_access as remote
from chromite.lib import stats
+from chromite.lib import timeout_util
from chromite.scripts import lddtree
@@ -164,7 +165,7 @@
# Developers sometimes run session_manager manually, in which case we'll
# need to help shut the chrome processes down.
try:
- with cros_build_lib.Timeout(KILL_PROC_MAX_WAIT):
+ with timeout_util.Timeout(KILL_PROC_MAX_WAIT):
while self._ChromeFileInUse():
logging.warning('The chrome binary on the device is in use.')
logging.warning('Killing chrome and session_manager processes...\n')
@@ -174,7 +175,7 @@
# Wait for processes to actually terminate
time.sleep(POST_KILL_WAIT)
logging.info('Rechecking the chrome binary...')
- except cros_build_lib.TimeoutError:
+ except timeout_util.TimeoutError:
msg = ('Could not kill processes after %s seconds. Please exit any '
'running chrome processes and try again.' % KILL_PROC_MAX_WAIT)
raise DeployFailure(msg)