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

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

Issue 27502002: Android perf tests: only store the retry results if it's better. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 7 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 | « build/android/pylib/perf/setup.py ('k') | 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 c1ad07f7c55c005fd521d16f48c937de12ffcf02..2225223766ad1645c93748fc50531b7b34ffb911 100644
--- a/build/android/pylib/perf/test_runner.py
+++ b/build/android/pylib/perf/test_runner.py
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Runs a perf test on a single device.
+"""Runs perf tests.
Our buildbot infrastructure requires each slave to run steps serially.
This is sub-optimal for android, where these steps can run independently on
@@ -96,10 +96,23 @@ class TestRunner(base_test_runner.BaseTestRunner):
self._flaky_tests = flaky_tests
@staticmethod
+ def _IsBetter(result):
+ if result['actual_exit_code'] == 0:
+ return True
+ pickled = os.path.join(constants.PERF_OUTPUT_DIR,
+ result['name'])
+ if not os.path.exists(pickled):
+ return True
+ with file(pickled, 'r') as f:
+ previous = pickle.loads(f.read())
+ return result['actual_exit_code'] < previous['actual_exit_code']
+
+ @staticmethod
def _SaveResult(result):
- with file(os.path.join(constants.PERF_OUTPUT_DIR,
- result['name']), 'w') as f:
- f.write(pickle.dumps(result))
+ if TestRunner._IsBetter(result):
+ with file(os.path.join(constants.PERF_OUTPUT_DIR,
+ result['name']), 'w') as f:
+ f.write(pickle.dumps(result))
def _LaunchPerfTest(self, test_name):
"""Runs a perf test.
@@ -135,6 +148,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
result_type = base_test_result.ResultType.FAIL
if exit_code == 0:
result_type = base_test_result.ResultType.PASS
+ actual_exit_code = exit_code
if test_name in self._flaky_tests:
# The exit_code is used at the second stage when printing the
# test output. If the test is flaky, force to "0" to get that step green
@@ -146,6 +160,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
'name': test_name,
'output': output,
'exit_code': exit_code,
+ 'actual_exit_code': actual_exit_code,
'result_type': result_type,
'total_time': (end_time - start_time).seconds,
'device': self.device,
« no previous file with comments | « build/android/pylib/perf/setup.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698