OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 import android_commands | |
7 import logging | 6 import logging |
8 import multiprocessing | 7 import multiprocessing |
9 | 8 |
10 from android_commands import errors | 9 from pylib import android_commands |
11 from forwarder import Forwarder | 10 from pylib.android_commands import errors |
craigdh
2013/01/15 23:00:05
Just change the 2 uses of this to android_commands
frankf
2013/01/16 21:34:04
Done.
| |
12 from test_result import TestResults | 11 from pylib.base.test_result import TestResults |
12 from pylib.forwarder import Forwarder | |
craigdh
2013/01/15 23:00:05
Should forwarder be in utils?
bulach
2013/01/16 09:45:50
if you do change this, please remember that "forwa
frankf
2013/01/16 21:34:04
I rather do this in a separate CL.
On 2013/01/16
| |
13 | 13 |
14 | 14 |
15 def _ShardedTestRunnable(test): | 15 def _ShardedTestRunnable(test): |
16 """Standalone function needed by multiprocessing.Pool.""" | 16 """Standalone function needed by multiprocessing.Pool.""" |
17 log_format = '[' + test.device + '] # %(asctime)-15s: %(message)s' | 17 log_format = '[' + test.device + '] # %(asctime)-15s: %(message)s' |
18 if logging.getLogger().handlers: | 18 if logging.getLogger().handlers: |
19 logging.getLogger().handlers[0].setFormatter(logging.Formatter(log_format)) | 19 logging.getLogger().handlers[0].setFormatter(logging.Formatter(log_format)) |
20 else: | 20 else: |
21 logging.basicConfig(format=log_format) | 21 logging.basicConfig(format=log_format) |
22 # Handle SystemExit here since python has a bug to exit current process | 22 # Handle SystemExit here since python has a bug to exit current process |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 self.tests += [t.name] | 144 self.tests += [t.name] |
145 if not self.tests: | 145 if not self.tests: |
146 break | 146 break |
147 else: | 147 else: |
148 # We ran out retries, possibly out of healthy devices. | 148 # We ran out retries, possibly out of healthy devices. |
149 # There's no recovery at this point. | 149 # There's no recovery at this point. |
150 raise Exception('Unrecoverable error while retrying test runs.') | 150 raise Exception('Unrecoverable error while retrying test runs.') |
151 self.OnTestsCompleted(test_runners, final_results) | 151 self.OnTestsCompleted(test_runners, final_results) |
152 self._KillHostForwarder() | 152 self._KillHostForwarder() |
153 return final_results | 153 return final_results |
OLD | NEW |