OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import logging | 5 import logging |
6 import os | 6 import os |
7 import posixpath | 7 import posixpath |
8 import re | 8 import re |
9 import time | 9 import time |
10 | 10 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 device, test_timeout_scale * self._test_instance.timeout_scale) | 248 device, test_timeout_scale * self._test_instance.timeout_scale) |
249 | 249 |
250 logging.info('preparing to run %s: %s', test_display_name, test) | 250 logging.info('preparing to run %s: %s', test_display_name, test) |
251 | 251 |
252 if flags: | 252 if flags: |
253 self._CreateFlagChangerIfNeeded(device) | 253 self._CreateFlagChangerIfNeeded(device) |
254 self._flag_changers[str(device)].PushFlags( | 254 self._flag_changers[str(device)].PushFlags( |
255 add=flags.add, remove=flags.remove) | 255 add=flags.add, remove=flags.remove) |
256 | 256 |
257 try: | 257 try: |
258 device.RunShellCommand( | |
259 ['log', '-p', 'i', '-t', | |
260 self._test_instance.test_package.split('.')[-1], | |
mikecase (-- gone --)
2016/10/01 01:04:38
is this tag just the word "tests"?
Like "org.chro
jbudorick
2016/10/04 21:54:25
Clearly wasn't thinking this through all the way.
| |
261 'START %s' % test_name], | |
262 check_return=True) | |
mikecase (-- gone --)
2016/10/01 01:04:38
So there will be two logs indicating the start of
jbudorick
2016/10/04 21:54:25
Correct.
| |
258 time_ms = lambda: int(time.time() * 1e3) | 263 time_ms = lambda: int(time.time() * 1e3) |
259 start_ms = time_ms() | 264 start_ms = time_ms() |
260 output = device.StartInstrumentation( | 265 output = device.StartInstrumentation( |
261 target, raw=True, extras=extras, timeout=timeout, retries=0) | 266 target, raw=True, extras=extras, timeout=timeout, retries=0) |
267 finally: | |
268 device.RunShellCommand( | |
269 ['log', '-p', 'i', '-t', | |
270 self._test_instance.test_package.split('.')[-1], | |
271 'END %s' % test_name], | |
272 check_return=True) | |
262 duration_ms = time_ms() - start_ms | 273 duration_ms = time_ms() - start_ms |
263 finally: | |
264 if flags: | 274 if flags: |
265 self._flag_changers[str(device)].Restore() | 275 self._flag_changers[str(device)].Restore() |
266 if test_timeout_scale: | 276 if test_timeout_scale: |
267 valgrind_tools.SetChromeTimeoutScale( | 277 valgrind_tools.SetChromeTimeoutScale( |
268 device, self._test_instance.timeout_scale) | 278 device, self._test_instance.timeout_scale) |
269 | 279 |
270 # TODO(jbudorick): Make instrumentation tests output a JSON so this | 280 # TODO(jbudorick): Make instrumentation tests output a JSON so this |
271 # doesn't have to parse the output. | 281 # doesn't have to parse the output. |
272 result_code, result_bundle, statuses = ( | 282 result_code, result_bundle, statuses = ( |
273 self._test_instance.ParseAmInstrumentRawOutput(output)) | 283 self._test_instance.ParseAmInstrumentRawOutput(output)) |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 timeout = v | 381 timeout = v |
372 break | 382 break |
373 else: | 383 else: |
374 logging.warning('Using default 1 minute timeout for %s', test_name) | 384 logging.warning('Using default 1 minute timeout for %s', test_name) |
375 timeout = 60 | 385 timeout = 60 |
376 | 386 |
377 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) | 387 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) |
378 | 388 |
379 return timeout | 389 return timeout |
380 | 390 |
OLD | NEW |