Merge lp:~javier.collado/utah/bug1197881 into lp:utah

Proposed by Javier Collado
Status: Merged
Merged at revision: 966
Proposed branch: lp:~javier.collado/utah/bug1197881
Merge into: lp:utah
Diff against target: 72 lines (+18/-8)
3 files modified
debian/changelog (+3/-0)
examples/run_utah_phablet.py (+9/-5)
utah/provisioning/touch.py (+6/-3)
To merge this branch: bzr merge lp:~javier.collado/utah/bug1197881
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
Review via email: mp+173999@code.launchpad.net

Description of the change

This branch applies a retry strategy to workaround the failures when running
`adb shell getprop` command.

An example of the retry strategy working can be seen here (look for
"retrying"):
https://jenkins.qa.ubuntu.com/job/memevent-saucy-touch-armhf-default-mako-01/56/consoleFull

To post a comment you must log in.
Revision history for this message
Javier Collado (javier.collado) wrote :

Note that `ADBShellError` is now a subclass of `UTAHException` because that's
required by the `retry` function to work correctly.

Revision history for this message
Max Brustkern (nuclearbob) wrote :

This looks good to me.

Revision history for this message
Andy Doan (doanac) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-07-03 21:47:30 +0000
3+++ debian/changelog 2013-07-10 17:03:31 +0000
4@@ -10,6 +10,9 @@
5 [ Max Brustkern ]
6 * Made url_argument return None for empty URLs (LP: #1195469)
7
8+ [ Javier Collado ]
9+ * Retry `adb shell getprop` on failures (LP: #1197881)
10+
11 -- Andy Doan <doanac@doanac-laptop> Tue, 25 Jun 2013 22:12:21 -0500
12
13 utah (0.13.1ubuntu1) raring; urgency=low
14
15=== modified file 'examples/run_utah_phablet.py'
16--- examples/run_utah_phablet.py 2013-07-03 21:45:11 +0000
17+++ examples/run_utah_phablet.py 2013-07-10 17:03:31 +0000
18@@ -28,8 +28,9 @@
19
20 from SimpleXMLRPCServer import SimpleXMLRPCServer
21
22+from utah import template
23 from utah.provisioning import touch
24-from utah import template
25+from utah.retry import retry
26
27 CLIENT_PROBES_DIR = '/tmp/utah-probes'
28
29@@ -99,10 +100,13 @@
30
31
32 def _save_props(device, results_dir):
33- props = device.run_ubuntu('getprop')
34- props_file = os.path.join(results_dir, 'adb.props')
35- with open(props_file, 'w') as f:
36- f.write(props)
37+ def run():
38+ props = device.run_ubuntu('getprop')
39+ props_file = os.path.join(results_dir, 'adb.props')
40+ with open(props_file, 'w') as f:
41+ f.write(props)
42+
43+ retry(run)
44
45
46 def _configure_autorun(device, event_name, env):
47
48=== modified file 'utah/provisioning/touch.py'
49--- utah/provisioning/touch.py 2013-07-03 19:58:19 +0000
50+++ utah/provisioning/touch.py 2013-07-10 17:03:31 +0000
51@@ -25,15 +25,18 @@
52
53 import utah.process as process
54
55-
56-class ADBShellError(Exception):
57+from utah.exceptions import UTAHException
58+
59+
60+class ADBShellError(UTAHException):
61
62 """An error occurred running an adb shell command."""
63
64- def __init__(self, cmd, stdout):
65+ def __init__(self, cmd, stdout, retry=True):
66 Exception.__init__(self, 'ERROR: running {}'.format(cmd))
67 self.cmd = cmd
68 self.stdout = stdout
69+ self.retry = retry
70
71 def long_message(self):
72 """return a long descriptive message about the error."""

Subscribers

People subscribed via source and target branches