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

Side by Side Diff: build/android/pylib/perf/test_runner.py

Issue 67463004: Android perf: force flushing stdout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Runs perf tests. 5 """Runs perf tests.
6 6
7 Our buildbot infrastructure requires each slave to run steps serially. 7 Our buildbot infrastructure requires each slave to run steps serially.
8 This is sub-optimal for android, where these steps can run independently on 8 This is sub-optimal for android, where these steps can run independently on
9 multiple connected devices. 9 multiple connected devices.
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 self._stopped.wait(_HeartBeatLogger._PRINT_INTERVAL) 99 self._stopped.wait(_HeartBeatLogger._PRINT_INTERVAL)
100 100
101 def write(self, data): 101 def write(self, data):
102 self._len += len(data) 102 self._len += len(data)
103 103
104 def flush(self): 104 def flush(self):
105 now = time.time() 105 now = time.time()
106 if now - self._tick >= _HeartBeatLogger._PRINT_INTERVAL: 106 if now - self._tick >= _HeartBeatLogger._PRINT_INTERVAL:
107 self._tick = now 107 self._tick = now
108 print '--single-step output length %d' % self._len 108 print '--single-step output length %d' % self._len
109 sys.stdout.flush()
109 110
110 def stop(self): 111 def stop(self):
111 self._stopped.set() 112 self._stopped.set()
112 113
113 114
114 class TestRunner(base_test_runner.BaseTestRunner): 115 class TestRunner(base_test_runner.BaseTestRunner):
115 def __init__(self, test_options, device, tests, flaky_tests): 116 def __init__(self, test_options, device, tests, flaky_tests):
116 """A TestRunner instance runs a perf test on a single device. 117 """A TestRunner instance runs a perf test on a single device.
117 118
118 Args: 119 Args:
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 Returns: 229 Returns:
229 A tuple of (TestRunResults, retry). 230 A tuple of (TestRunResults, retry).
230 """ 231 """
231 output, result_type = self._LaunchPerfTest(test_name) 232 output, result_type = self._LaunchPerfTest(test_name)
232 results = base_test_result.TestRunResults() 233 results = base_test_result.TestRunResults()
233 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) 234 results.AddResult(base_test_result.BaseTestResult(test_name, result_type))
234 retry = None 235 retry = None
235 if not results.DidRunPass(): 236 if not results.DidRunPass():
236 retry = test_name 237 retry = test_name
237 return results, retry 238 return results, retry
OLDNEW
« 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