| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 logging.info('Output from:') | 76 logging.info('Output from:') |
| 77 logging.info(persisted_result['cmd']) | 77 logging.info(persisted_result['cmd']) |
| 78 logging.info('*' * 80) | 78 logging.info('*' * 80) |
| 79 print persisted_result['output'] | 79 print persisted_result['output'] |
| 80 | 80 |
| 81 return persisted_result['exit_code'] | 81 return persisted_result['exit_code'] |
| 82 | 82 |
| 83 | 83 |
| 84 class _HeartBeatLogger(object): | 84 class _HeartBeatLogger(object): |
| 85 # How often to print the heartbeat on flush(). | 85 # How often to print the heartbeat on flush(). |
| 86 _PRINT_INTERVAL = 600 | 86 _PRINT_INTERVAL = 30.0 |
| 87 | 87 |
| 88 def __init__(self): | 88 def __init__(self): |
| 89 """A file-like class for keeping the buildbot alive.""" | 89 """A file-like class for keeping the buildbot alive.""" |
| 90 self._len = 0 | 90 self._len = 0 |
| 91 self._tick = time.time() | 91 self._tick = time.time() |
| 92 self._stopped = threading.Event() | 92 self._stopped = threading.Event() |
| 93 self._timer = threading.Thread(target=self._runner) | 93 self._timer = threading.Thread(target=self._runner) |
| 94 self._timer.start() | 94 self._timer.start() |
| 95 | 95 |
| 96 def _runner(self): | 96 def _runner(self): |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 Returns: | 228 Returns: |
| 229 A tuple of (TestRunResults, retry). | 229 A tuple of (TestRunResults, retry). |
| 230 """ | 230 """ |
| 231 output, result_type = self._LaunchPerfTest(test_name) | 231 output, result_type = self._LaunchPerfTest(test_name) |
| 232 results = base_test_result.TestRunResults() | 232 results = base_test_result.TestRunResults() |
| 233 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) | 233 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) |
| 234 retry = None | 234 retry = None |
| 235 if not results.DidRunPass(): | 235 if not results.DidRunPass(): |
| 236 retry = test_name | 236 retry = test_name |
| 237 return results, retry | 237 return results, retry |
| OLD | NEW |