From 1a236fb8995588e2ea85b7a03795e6f9c112222e Mon Sep 17 00:00:00 2001 From: Sergiy Byelozyorov Date: Wed, 12 Sep 2018 16:57:46 +0200 Subject: [PATCH] [tools] Print command output on timeout R=machenbach@chromium.org Bug: chromium:872257 Change-Id: I6eb1f70e0d44c76e18eb4f6f936c7f2cf0380444 Reviewed-on: https://chromium-review.googlesource.com/1217942 Commit-Queue: Sergiy Byelozyorov Reviewed-by: Michael Achenbach Cr-Commit-Position: refs/heads/master@{#55834} --- DEPS | 2 +- tools/run_perf.py | 4 +++- tools/testrunner/local/android.py | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index 490068b4d7..2bdb710af3 100644 --- a/DEPS +++ b/DEPS @@ -33,7 +33,7 @@ deps = { 'condition': 'checkout_android', }, 'v8/third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '134ee369521c676229d0c4c38a96fb54a5ab4967', + 'url': Var('chromium_url') + '/catapult.git' + '@' + '79834ec727ba63d7364a46cef7c85284b7152266', 'condition': 'checkout_android', }, 'v8/third_party/colorama/src': { diff --git a/tools/run_perf.py b/tools/run_perf.py index 310bd8a008..67861db3ea 100755 --- a/tools/run_perf.py +++ b/tools/run_perf.py @@ -780,7 +780,9 @@ class AndroidPlatform(Platform): # pragma: no cover except android.CommandFailedException as e: logging.info(title % "Stdout" + "\n%s", e.output) raise - except android.TimeoutException: + except android.TimeoutException as e: + if e.output: + logging.info(title % "Stdout" + "\n%s", e.output) logging.warning(">>> Test timed out after %ss.", runnable.timeout) stdout = "" if runnable.process_size: diff --git a/tools/testrunner/local/android.py b/tools/testrunner/local/android.py index fb25bb5a17..707614f095 100644 --- a/tools/testrunner/local/android.py +++ b/tools/testrunner/local/android.py @@ -18,8 +18,9 @@ DEVICE_DIR = '/data/local/tmp/v8/' class TimeoutException(Exception): - def __init__(self, timeout): + def __init__(self, timeout, output=None): self.timeout = timeout + self.output = output class CommandFailedException(Exception): @@ -170,8 +171,8 @@ class _Driver(object): return '\n'.join(output) except device_errors.AdbCommandFailedError as e: raise CommandFailedException(e.status, e.output) - except device_errors.CommandTimeoutError: - raise TimeoutException(timeout) + except device_errors.CommandTimeoutError as e: + raise TimeoutException(timeout, e.output) if logcat_file: