| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |