| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 io | 6 import io |
| 7 import json | 7 import json |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import pickle | 10 import pickle |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 for test in self._tests: | 238 for test in self._tests: |
| 239 tries_left = self._retries | 239 tries_left = self._retries |
| 240 result_type = None | 240 result_type = None |
| 241 while (result_type != base_test_result.ResultType.PASS | 241 while (result_type != base_test_result.ResultType.PASS |
| 242 and tries_left > 0): | 242 and tries_left > 0): |
| 243 try: | 243 try: |
| 244 self._TestSetUp(test) | 244 self._TestSetUp(test) |
| 245 result_type = self._RunSingleTest(test) | 245 result_type = self._RunSingleTest(test) |
| 246 except device_errors.CommandTimeoutError: | 246 except device_errors.CommandTimeoutError: |
| 247 result_type = base_test_result.ResultType.TIMEOUT | 247 result_type = base_test_result.ResultType.TIMEOUT |
| 248 except device_errors.CommandFailedError: | 248 except (device_errors.CommandFailedError, |
| 249 device_errors.DeviceUnreachableError): |
| 249 logging.exception('Exception when executing %s.', test) | 250 logging.exception('Exception when executing %s.', test) |
| 250 result_type = base_test_result.ResultType.FAIL | 251 result_type = base_test_result.ResultType.FAIL |
| 251 finally: | 252 finally: |
| 252 self._TestTearDown() | 253 self._TestTearDown() |
| 253 if result_type != base_test_result.ResultType.PASS: | 254 if result_type != base_test_result.ResultType.PASS: |
| 254 try: | 255 try: |
| 255 device_recovery.RecoverDevice(self._device, self._env.blacklist) | 256 device_recovery.RecoverDevice(self._device, self._env.blacklist) |
| 256 except device_errors.CommandTimeoutError: | 257 except device_errors.CommandTimeoutError: |
| 257 logging.exception( | 258 logging.exception( |
| 258 'Device failed to recover after failing %s.', test) | 259 'Device failed to recover after failing %s.', test) |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 # override | 530 # override |
| 530 def _RunTest(self, _device, _test): | 531 def _RunTest(self, _device, _test): |
| 531 raise NotImplementedError | 532 raise NotImplementedError |
| 532 | 533 |
| 533 | 534 |
| 534 class TestDictVersionError(Exception): | 535 class TestDictVersionError(Exception): |
| 535 pass | 536 pass |
| 536 | 537 |
| 537 class PerfTestRunGetStepsError(Exception): | 538 class PerfTestRunGetStepsError(Exception): |
| 538 pass | 539 pass |
| OLD | NEW |