Commit e3843051 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Capture more tombstones in instrumentation tests

When chrome_public_smoke_test has a crash, our test runner does not
notice and so does not collect tombstones.

This changes the "are there tombstones" logic to look for a tombstone
message in logcat rather than looking to see if any tests crashed.

Bug: 1117540
Change-Id: Ic0594f0d8dcb2cb8c7280ade9d8d5133c890614f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363075Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799490}
parent 2bcca8f2
......@@ -783,24 +783,30 @@ class LocalDeviceInstrumentationTestRun(
logging.debug('raw output from %s:', test_display_name)
for l in output:
logging.debug(' %s', l)
if self._test_instance.store_tombstones:
tombstones_url = None
for result in results:
if result.GetType() == base_test_result.ResultType.CRASH:
if not tombstones_url:
resolved_tombstones = tombstones.ResolveTombstones(
device,
resolve_all_tombstones=True,
include_stack_symbols=False,
wipe_tombstones=True,
tombstone_symbolizer=self._test_instance.symbolizer)
tombstone_filename = 'tombstones_%s_%s' % (
time.strftime('%Y%m%dT%H%M%S-UTC', time.gmtime()),
device.serial)
with self._env.output_manager.ArchivedTempfile(
tombstone_filename, 'tombstones') as tombstone_file:
tombstone_file.write('\n'.join(resolved_tombstones))
resolved_tombstones = tombstones.ResolveTombstones(
device,
resolve_all_tombstones=True,
include_stack_symbols=False,
wipe_tombstones=True,
tombstone_symbolizer=self._test_instance.symbolizer)
if resolved_tombstones:
tombstone_filename = 'tombstones_%s_%s' % (time.strftime(
'%Y%m%dT%H%M%S-UTC', time.gmtime()), device.serial)
with self._env.output_manager.ArchivedTempfile(
tombstone_filename, 'tombstones') as tombstone_file:
tombstone_file.write('\n'.join(resolved_tombstones))
# Associate tombstones with first crashing test.
for result in results:
if result.GetType() == base_test_result.ResultType.CRASH:
result.SetLink('tombstones', tombstone_file.Link())
break
else:
# We don't always detect crashes correctly. In this case,
# associate with the first test.
results[0].SetLink('tombstones', tombstone_file.Link())
return results, None
def _GetTestsFromRunner(self):
......
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