New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 598496 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: ----

Blocking:
issue 597687



Sign in to add a comment

Add specified exception type to Retry

Project Member Reported by xixuan@chromium.org, Mar 29 2016

Issue description

Currently, the callers can't specify the exception to raise when they calling function retry(). 

It will end with 'timeout exception' or some sys exceptions, which make the callers harder to catch a fixed type of exception, such as ServoHostVerifyFailure, or DevServerException. Furthermore, it makes the logging more confused.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/a96aff052fa67057f5cdd70cafe7b5f9cb795989

commit a96aff052fa67057f5cdd70cafe7b5f9cb795989
Author: xixuan <xixuan@google.com>
Date: Tue Mar 29 21:22:08 2016

Autotest: Add specified exception type to Retry for dev_server and servo

After adding ssh feature to dev_server and servo, we need to do retry
when meeting error.CmdError (ssh error). However a specified error type
needs to raised after retry, in order to be caught by its caller.

For example, a caller needs to call dev_server.get_control_file(). The ideal
case is we retry ssh connections to dev_server if it fails. When retry
is finished, we need it to raise a DevServerException, which is
currently caught by the caller.

This CL adds a specified exception to raise in retry, and also
refactors the error msg raising processes.

BUG= chromium:598496 
TEST=Checked dev_server and servo raise the corresponding error types in
local autotest instance. Ran dev_server_unittest.

Change-Id: I53ad52b2c397beeb922d75539b63eaf9b6632c86
Reviewed-on: https://chromium-review.googlesource.com/335901
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>

[modify] https://crrev.com/a96aff052fa67057f5cdd70cafe7b5f9cb795989/client/common_lib/cros/dev_server.py
[modify] https://crrev.com/a96aff052fa67057f5cdd70cafe7b5f9cb795989/client/common_lib/cros/retry.py
[modify] https://crrev.com/a96aff052fa67057f5cdd70cafe7b5f9cb795989/client/common_lib/cros/dev_server_unittest.py
[modify] https://crrev.com/a96aff052fa67057f5cdd70cafe7b5f9cb795989/site_utils/test_push_unittest.py

Comment 2 by benhenry@google.com, Apr 26 2016

Components: Infra>Client>ChromeOS
Labels: -Infra-ChromeOS
Status: Fixed (was: Assigned)
Closing... please feel free to reopen if its not fixed.
Status: Verified (was: Fixed)

Sign in to add a comment