Commit ddf32ac6 authored by jbudorick's avatar jbudorick Committed by Commit bot

[Android] Log instr test start & end.

BUG=651984

Review-Url: https://codereview.chromium.org/2385673005
Cr-Commit-Position: refs/heads/master@{#423012}
parent 7a9db510
...@@ -17,6 +17,9 @@ from pylib.local.device import local_device_environment ...@@ -17,6 +17,9 @@ from pylib.local.device import local_device_environment
from pylib.local.device import local_device_test_run from pylib.local.device import local_device_test_run
import tombstones import tombstones
_TAG = 'test_runner_py'
TIMEOUT_ANNOTATIONS = [ TIMEOUT_ANNOTATIONS = [
('Manual', 10 * 60 * 60), ('Manual', 10 * 60 * 60),
('IntegrationTest', 30 * 60), ('IntegrationTest', 30 * 60),
...@@ -255,12 +258,18 @@ class LocalDeviceInstrumentationTestRun( ...@@ -255,12 +258,18 @@ class LocalDeviceInstrumentationTestRun(
add=flags.add, remove=flags.remove) add=flags.add, remove=flags.remove)
try: try:
device.RunShellCommand(
['log', '-p', 'i', '-t', _TAG, 'START %s' % test_name],
check_return=True)
time_ms = lambda: int(time.time() * 1e3) time_ms = lambda: int(time.time() * 1e3)
start_ms = time_ms() start_ms = time_ms()
output = device.StartInstrumentation( output = device.StartInstrumentation(
target, raw=True, extras=extras, timeout=timeout, retries=0) target, raw=True, extras=extras, timeout=timeout, retries=0)
duration_ms = time_ms() - start_ms
finally: finally:
device.RunShellCommand(
['log', '-p', 'i', '-t', _TAG, 'END %s' % test_name],
check_return=True)
duration_ms = time_ms() - start_ms
if flags: if flags:
self._flag_changers[str(device)].Restore() self._flag_changers[str(device)].Restore()
if test_timeout_scale: if test_timeout_scale:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment