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

Unified Diff: build/android/pylib/perf/test_runner.py

Issue 649423002: Try to wait for devices to come back after a perf test failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/perf/test_runner.py
diff --git a/build/android/pylib/perf/test_runner.py b/build/android/pylib/perf/test_runner.py
index d74499f704850588a755ea79fb3d9930772a6f78..4b44c843fba51414a110b691795fa624ce2a2a98 100644
--- a/build/android/pylib/perf/test_runner.py
+++ b/build/android/pylib/perf/test_runner.py
@@ -62,6 +62,9 @@ from pylib import forwarder
from pylib.base import base_test_result
from pylib.base import base_test_runner
+sys.path.append(os.path.join(
jbudorick 2014/10/15 08:06:18 (see comment below first) this would become fr
tonyg 2014/10/15 16:47:27 Done.
+ constants.DIR_SOURCE_ROOT, 'third_party', 'android_testrunner'))
+import errors
def OutputJsonList(json_input, json_output):
with file(json_input, 'r') as i:
@@ -252,9 +255,19 @@ class TestRunner(base_test_runner.BaseTestRunner):
logging.info('%s : exit_code=%d in %d secs at %s',
test_name, exit_code, (end_time - start_time).seconds,
self.device_serial)
- result_type = base_test_result.ResultType.FAIL
+
if exit_code == 0:
result_type = base_test_result.ResultType.PASS
+ else:
+ result_type = base_test_result.ResultType.FAIL
+ # Since perf tests use device affinity, give the device a chance to
+ # recover if it is offline after a failure. Otherwise, the master sharder
+ # will remove it from the pool and future tests on this device will fail.
+ try:
+ self.device.old_interface.WaitForDevicePm()
jbudorick 2014/10/15 08:06:18 I'd rather see this use: self.device.WaitUntilF
tonyg 2014/10/15 16:47:27 Done.
+ except errors.WaitForResponseTimedOutError as e:
jbudorick 2014/10/15 08:06:18 this would become except device_errors.CommandT
tonyg 2014/10/15 16:47:27 Done.
+ logging.error('Device failed to return after %s: %s' % (test_name, e))
+
actual_exit_code = exit_code
if test_name in self._flaky_tests:
# The exit_code is used at the second stage when printing the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698