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 a perf test on a single device. | 5 """Runs a perf test on a single device. |
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 Args: | 107 Args: |
108 test_name: the name of the test to be executed. | 108 test_name: the name of the test to be executed. |
109 | 109 |
110 Returns: | 110 Returns: |
111 A tuple containing (Output, base_test_result.ResultType) | 111 A tuple containing (Output, base_test_result.ResultType) |
112 """ | 112 """ |
113 cmd = ('%s --device %s --keep_test_server_ports' % | 113 cmd = ('%s --device %s --keep_test_server_ports' % |
114 (self._tests[test_name], self.device)) | 114 (self._tests[test_name], self.device)) |
115 logging.info('%s : %s', test_name, cmd) | 115 logging.info('%s : %s', test_name, cmd) |
116 start_time = datetime.datetime.now() | 116 start_time = datetime.datetime.now() |
| 117 |
| 118 timeout = 1800 |
| 119 if self._options.no_timeout: |
| 120 timeout = None |
| 121 |
117 output, exit_code = pexpect.run( | 122 output, exit_code = pexpect.run( |
118 cmd, cwd=os.path.abspath(constants.DIR_SOURCE_ROOT), | 123 cmd, cwd=os.path.abspath(constants.DIR_SOURCE_ROOT), |
119 withexitstatus=True, logfile=sys.stdout, timeout=1800, | 124 withexitstatus=True, logfile=sys.stdout, timeout=timeout, |
120 env=os.environ) | 125 env=os.environ) |
121 end_time = datetime.datetime.now() | 126 end_time = datetime.datetime.now() |
122 if exit_code is None: | 127 if exit_code is None: |
123 exit_code = -1 | 128 exit_code = -1 |
124 logging.info('%s : exit_code=%d in %d secs at %s', | 129 logging.info('%s : exit_code=%d in %d secs at %s', |
125 test_name, exit_code, (end_time - start_time).seconds, | 130 test_name, exit_code, (end_time - start_time).seconds, |
126 self.device) | 131 self.device) |
127 result_type = base_test_result.ResultType.FAIL | 132 result_type = base_test_result.ResultType.FAIL |
128 if exit_code == 0: | 133 if exit_code == 0: |
129 result_type = base_test_result.ResultType.PASS | 134 result_type = base_test_result.ResultType.PASS |
(...skipping 23 matching lines...) Expand all Loading... |
153 Returns: | 158 Returns: |
154 A tuple of (TestRunResults, retry). | 159 A tuple of (TestRunResults, retry). |
155 """ | 160 """ |
156 output, result_type = self._LaunchPerfTest(test_name) | 161 output, result_type = self._LaunchPerfTest(test_name) |
157 results = base_test_result.TestRunResults() | 162 results = base_test_result.TestRunResults() |
158 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) | 163 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) |
159 retry = None | 164 retry = None |
160 if not results.DidRunPass(): | 165 if not results.DidRunPass(): |
161 retry = test_name | 166 retry = test_name |
162 return results, retry | 167 return results, retry |
OLD | NEW |