Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: build/android/pylib/local/device/local_device_perf_test_run.py

Issue 2811993002: [devil refactor] Prepare clients for DeviceUnreachableError (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/pylib/local/device/local_device_gtest_run.py ('k') | build/android/tombstones.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « build/android/pylib/local/device/local_device_gtest_run.py ('k') | build/android/tombstones.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698