OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Run specific test on specific environment.""" | 5 """Run specific test on specific environment.""" |
6 | 6 |
7 import json | 7 import json |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 heartbeat_counter = 0 | 86 heartbeat_counter = 0 |
87 if heartbeat_counter > self.HEARTBEAT_INTERVAL: | 87 if heartbeat_counter > self.HEARTBEAT_INTERVAL: |
88 logging.info('Test status: %s', self._results['detailed_status']) | 88 logging.info('Test status: %s', self._results['detailed_status']) |
89 heartbeat_counter = 0 | 89 heartbeat_counter = 0 |
90 | 90 |
91 timeout = self._env.timeouts.get( | 91 timeout = self._env.timeouts.get( |
92 current_status, self._env.timeouts['unknown']) | 92 current_status, self._env.timeouts['unknown']) |
93 if timeout_counter > timeout: | 93 if timeout_counter > timeout: |
94 raise remote_device_helper.RemoteDeviceError( | 94 raise remote_device_helper.RemoteDeviceError( |
95 'Timeout while in %s state for %s seconds' | 95 'Timeout while in %s state for %s seconds' |
96 % (current_status, timeout)) | 96 % (current_status, timeout), |
| 97 is_infra_error=True) |
97 time.sleep(self.WAIT_TIME) | 98 time.sleep(self.WAIT_TIME) |
98 timeout_counter += self.WAIT_TIME | 99 timeout_counter += self.WAIT_TIME |
99 heartbeat_counter += self.WAIT_TIME | 100 heartbeat_counter += self.WAIT_TIME |
100 self._DownloadTestResults(self._env.results_path) | 101 self._DownloadTestResults(self._env.results_path) |
101 return self._ParseTestResults() | 102 return self._ParseTestResults() |
102 | 103 |
103 #override | 104 #override |
104 def TearDown(self): | 105 def TearDown(self): |
105 """Tear down the test run.""" | 106 """Tear down the test run.""" |
106 if self._env.collect: | 107 if self._env.collect: |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 config_data.extend('%s=%s' % (k, v) for k, v in body.iteritems()) | 271 config_data.extend('%s=%s' % (k, v) for k, v in body.iteritems()) |
271 config.write(''.join('%s\n' % l for l in config_data)) | 272 config.write(''.join('%s\n' % l for l in config_data)) |
272 config.flush() | 273 config.flush() |
273 config.seek(0) | 274 config.seek(0) |
274 with appurify_sanitized.SanitizeLogging(self._env.verbose_count, | 275 with appurify_sanitized.SanitizeLogging(self._env.verbose_count, |
275 logging.WARNING): | 276 logging.WARNING): |
276 config_response = appurify_sanitized.api.config_upload( | 277 config_response = appurify_sanitized.api.config_upload( |
277 self._env.token, config, self._test_id) | 278 self._env.token, config, self._test_id) |
278 remote_device_helper.TestHttpResponse( | 279 remote_device_helper.TestHttpResponse( |
279 config_response, 'Unable to upload test config.') | 280 config_response, 'Unable to upload test config.') |
OLD | NEW |