Index: build/android/pylib/remote/device/remote_device_test_run.py |
diff --git a/build/android/pylib/remote/device/remote_device_test_run.py b/build/android/pylib/remote/device/remote_device_test_run.py |
index b82b06a4e5225b68ba98ef00632217731be71091..30d5a0d6b6771b4756c64fc9e98afd1506ef91e7 100644 |
--- a/build/android/pylib/remote/device/remote_device_test_run.py |
+++ b/build/android/pylib/remote/device/remote_device_test_run.py |
@@ -23,8 +23,8 @@ from pylib.remote.device import remote_device_helper |
from pylib.utils import zip_utils |
_DEVICE_OFFLINE_RE = re.compile('error: device not found') |
-_LONG_MSG_RE = re.compile('longMsg=') |
-_SHORT_MSG_RE = re.compile('shortMsg=') |
+_LONG_MSG_RE = re.compile('longMsg=(.*)$') |
+_SHORT_MSG_RE = re.compile('shortMsg=(.*)$') |
class RemoteDeviceTestRun(test_run.TestRun): |
@@ -366,24 +366,27 @@ class RemoteDeviceTestRun(test_run.TestRun): |
def _DetectPlatformErrors(self, results): |
if not self._results['results']['pass']: |
- if any(_SHORT_MSG_RE.search(l) |
- for l in self._results['results']['output'].splitlines()): |
+ crash_msg = None |
+ for line in self._results['results']['output'].splitlines(): |
+ m = _LONG_MSG_RE.search(line) |
+ if m: |
+ crash_msg = m.group(1) |
+ break |
+ m = _SHORT_MSG_RE.search(line) |
+ if m: |
+ crash_msg = m.group(1) |
+ if crash_msg: |
self._LogLogcat() |
- for line in self._results['results']['output'].splitlines(): |
- if _LONG_MSG_RE.search(line): |
- results.AddResult(base_test_result.BaseTestResult( |
- line.split('=')[1], base_test_result.ResultType.CRASH)) |
- break |
- else: |
- results.AddResult(base_test_result.BaseTestResult( |
- 'Unknown platform error detected.', |
- base_test_result.ResultType.UNKNOWN)) |
+ results.AddResult(base_test_result.BaseTestResult( |
+ crash_msg, base_test_result.ResultType.CRASH)) |
elif self._DidDeviceGoOffline(): |
self._LogLogcat() |
self._LogAdbTraceLog() |
raise remote_device_helper.RemoteDeviceError( |
'Remote service unable to reach device.', is_infra_error=True) |
else: |
- results.AddResult(base_test_result.BaseTestResult( |
- 'Remote Service detected error.', |
- base_test_result.ResultType.UNKNOWN)) |
+ # Remote service is reporting a failure, but no failure in results obj. |
+ if results.DidRunPass(): |
+ results.AddResult(base_test_result.BaseTestResult( |
+ 'Remote Service detected error.', |
+ base_test_result.ResultType.UNKNOWN)) |