History log of /external/autotest/client/common_lib/cros/retry_unittest.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d188984d9aef5a4ff09d8d459b5b3a6c46789fb0 05-Jun-2015 Matthew Sartori <msartori@chromium.org> [autotest] Retry with backoff for RPCs

Use chromite.lib.retry_util to run RPCs with exponential
backoff. The chromite library cannot be safely imported into
client/common_lib, preventing us from adding to the retry module.
So, we use chromite's retry_util directly when issuing RPCs to
get the desired backoff behaviour.

BUG=chromium:493219
Test=Tested that test suites were runnable with these changes on
a moblab. Tested the new retry logic with a stubbed function to
retry.

Change-Id: Ia5aac84d3e475a022867b4ca43d8f6bb0fb05d7a
Reviewed-on: https://chromium-review.googlesource.com/275699
Tested-by: Matthew Sartori <msartori@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Matthew Sartori <msartori@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py
db550114d3137db4fca4b9b6ae8a95ef38292aea 02-Jun-2015 Matthew Sartori <msartori@chromium.org> [autotest] Retry with backoff for RPCs

Create a new retry function in the autotest retry module.
This function provides a very similar interface to the current
retry function. This new function does not rely on jittered delays,
but uses the chromite retry_util module to provide backoff behaviour.

BUG=chromium:493219
TEST=Tested with unittests.

Change-Id: I55642954d90e9b7dc14b2ea9f09691a5fa7dda56
Reviewed-on: https://chromium-review.googlesource.com/274864
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Matthew Sartori <msartori@chromium.org>
Tested-by: Matthew Sartori <msartori@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py
d5dde48725dae3292fac669a93d4ab53285a3262 20-Nov-2014 Tom Wai-Hong Tam <waihong@chromium.org> Remove the non-client dependency from the retry module

The client module retry depends on a non-client module, i.e. the proxy module
of frontend.afe.json_rpc. This dependency prevents any client-side code
from importing the retry module.

Searching for the entire code base of Autotest, this proxy thing is used
only by the frontend_wrappers. So moved it to the frontend_wrappers.

Also fixed its unit test.

BUG=chromium:434943
TEST=retry_unittest.py passed.

Change-Id: Id9963068ea328ce357df6521d186fd9fa6d0a72b
Reviewed-on: https://chromium-review.googlesource.com/231152
Tested-by: Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Wai-Hong Tam <waihong@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py
60aec2423a2c2a14c46dc21757a6fd748931f428 26-Jun-2013 beeps <beeps@chromium.org> [autotest] Divorce the devserver retry requests and sigalarm.

All dev_server requests made from the client go through a retry
wrapper that uses sigalarm to expedite unresponsive calls. Since
we cannot register our signal handlers with mod wsgi, this cl
modifies the urlopen call to manage an internal socket timeout
instead. In order to continue retrying on other URLErrors, the
urlopen wrapper in site_utils converts socket timeouts to
TimeoutExceptions.

TEST=
1. Added a bad devserver, tried to run_suite on a build that hashed
to said devserver with and without this change and verified that
it only worked in the latter case.
2. Sigalarm still fires when devserver's resolve is called outside wsgi,
and urlopen has a larger timeout.
3. Non TimeoutException URLErrors retry.
4. dev_server_unittest pass.
BUG=chromium:246209

Change-Id: Iec9ef39982f4c8b92e260cf27bf454e624bccfa9
Reviewed-on: https://gerrit.chromium.org/gerrit/58659
Tested-by: Prashanth Balasubramanian <beeps@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Prashanth Balasubramanian <beeps@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py
6d31f80d0cdb3ca638b465526a6c5ae9a3ec3c74 11-Jan-2013 Dan Shi <dshi@google.com> [autotest] adding a timeout to retry decorator.

Use signal.SIGALRM to prevent retry method from hang

signal.SIGALRM is used to timeout retry method after a given amount of
time. The default timeout value is set to timeout_min, which is used as
timeout value in minutes until all retries give up.

Relanding I88f24f281cc1b8f9cb82ba10aae31a8345722d28.
BUG=chromium-os:34424
TEST=run unit test retry_unittest.py

Change-Id: I19a130e6fd5b919b5801f9cc4ac3272eb36cabe6
Reviewed-on: https://gerrit.chromium.org/gerrit/41157
Commit-Queue: Alex Miller <milleral@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py
320dac9b7b1fcd242d92036c706828afdf6d8de3 10-Jan-2013 Alex Miller <milleral@chromium.org> Revert "[autotest] adding a timeout to retry decorator."

...somehow causing lab breakage again. I'm really sorry.

This reverts commit 7b33c1a6335f961de37ea1262fcd91846bc5b66b

Change-Id: Id30665504933131b9a75e84927e71d2b8bbbfef0
Reviewed-on: https://gerrit.chromium.org/gerrit/41000
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py
7b33c1a6335f961de37ea1262fcd91846bc5b66b 21-Dec-2012 Dan Shi <dshi@google.com> [autotest] adding a timeout to retry decorator.

Use signal.SIGALRM to prevent retry method from hang

signal.SIGALRM is used to timeout retry method after a given amount of
time. The default timeout value is set to timeout_min, which is used as
timeout value in minutes until all retries give up.

Relanding I88f24f281cc1b8f9cb82ba10aae31a8345722d28.

BUG=chromium-os:34424
TEST=run unit test retry_unittest.py

CQ-DEPEND=I71643fe3de02de7b13140b799a4530b2e1ed7b3a
Change-Id: I37e9a69acbcf8ba285fef67be3243e6fb0c7f723
Reviewed-on: https://gerrit.chromium.org/gerrit/40604
Reviewed-by: Alex Miller <milleral@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py
ddb5674857ece80748186132f682b3fc7d56e5c5 08-Jan-2013 Alex Miller <milleral@chromium.org> Revert "[autotest] adding a timeout to retry decorator."

It turns out that this works too well, and breaks things
that rely on timeouts being sloppy.

This reverts commit 76b921e3b197d84f03523e7f6b924ec1fc3cf585

Change-Id: Iceb6eca10d8239e58941d9d060fc7c76bd47d408
Reviewed-on: https://gerrit.chromium.org/gerrit/40599
Commit-Queue: Alex Miller <milleral@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py
76b921e3b197d84f03523e7f6b924ec1fc3cf585 21-Dec-2012 Dan Shi <dshi@google.com> [autotest] adding a timeout to retry decorator.

Use signal.SIGALRM to prevent retry method from hang

signal.SIGALRM is used to timeout retry method after a given amount of
time. The default timeout value is set to timeout_min, which is used as
timeout value in minutes until all retries give up.

BUG=chromium-os:34424
TEST=run unit test retry_unittest.py
Change-Id: I88f24f281cc1b8f9cb82ba10aae31a8345722d28
Reviewed-on: https://gerrit.chromium.org/gerrit/40095
Reviewed-by: Craig Harrison <craigdh@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py
40d7149c950ec1cf86cccbe07a89af7e5edb9bb5 17-Aug-2012 Chris Masone <cmasone@chromium.org> [autotest] Fix and move FrontendWrappers unittests

The FrontendWrappersTest class wasn't testing the (now minimal) code
in frontend_wrappers.py. The meat of that was moved to
client/common_lib/cros/retry.py a while ago. So, move the tests there
as well, and also mock out time.sleep() so that we can run them
faster, while also setting better expectations on them.

BUG=None
TEST=unittests

Change-Id: Id100b45af3740bdc8d347fbadf762ff3bc7af80a
Reviewed-on: https://gerrit.chromium.org/gerrit/30598
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/external/autotest/client/common_lib/cros/retry_unittest.py