OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import collections | 5 import collections |
6 import itertools | 6 import itertools |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import posixpath | 9 import posixpath |
10 import time | 10 import time |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 extras[_EXTRA_STDOUT_FILE] = stdout_file.name | 165 extras[_EXTRA_STDOUT_FILE] = stdout_file.name |
166 | 166 |
167 with command_line_file, test_list_file, stdout_file: | 167 with command_line_file, test_list_file, stdout_file: |
168 try: | 168 try: |
169 device.StartInstrumentation( | 169 device.StartInstrumentation( |
170 self._component, extras=extras, raw=False, **kwargs) | 170 self._component, extras=extras, raw=False, **kwargs) |
171 except device_errors.CommandFailedError: | 171 except device_errors.CommandFailedError: |
172 logging.exception('gtest shard failed.') | 172 logging.exception('gtest shard failed.') |
173 except device_errors.CommandTimeoutError: | 173 except device_errors.CommandTimeoutError: |
174 logging.exception('gtest shard timed out.') | 174 logging.exception('gtest shard timed out.') |
| 175 except device_errors.DeviceUnreachableError: |
| 176 logging.exception('gtest shard device unreachable.') |
175 except Exception: | 177 except Exception: |
176 device.ForceStop(self._package) | 178 device.ForceStop(self._package) |
177 raise | 179 raise |
178 return device.ReadFile(stdout_file.name).splitlines() | 180 return device.ReadFile(stdout_file.name).splitlines() |
179 | 181 |
180 def PullAppFiles(self, device, files, directory): | 182 def PullAppFiles(self, device, files, directory): |
181 PullAppFilesImpl(device, self._package, files, directory) | 183 PullAppFilesImpl(device, self._package, files, directory) |
182 | 184 |
183 def Clear(self, device): | 185 def Clear(self, device): |
184 device.ClearApplicationState(self._package, permissions=self._permissions) | 186 device.ClearApplicationState(self._package, permissions=self._permissions) |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 @local_device_environment.handle_shard_failures | 464 @local_device_environment.handle_shard_failures |
463 @trace_event.traced | 465 @trace_event.traced |
464 def individual_device_tear_down(dev): | 466 def individual_device_tear_down(dev): |
465 for s in self._servers.get(str(dev), []): | 467 for s in self._servers.get(str(dev), []): |
466 s.TearDown() | 468 s.TearDown() |
467 | 469 |
468 tool = self.GetTool(dev) | 470 tool = self.GetTool(dev) |
469 tool.CleanUpEnvironment() | 471 tool.CleanUpEnvironment() |
470 | 472 |
471 self._env.parallel_devices.pMap(individual_device_tear_down) | 473 self._env.parallel_devices.pMap(individual_device_tear_down) |
OLD | NEW |