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( ...@@ -783,24 +783,30 @@ class LocalDeviceInstrumentationTestRun(
logging.debug('raw output from %s:', test_display_name) logging.debug('raw output from %s:', test_display_name)
for l in output: for l in output:
logging.debug(' %s', l) logging.debug(' %s', l)
if self._test_instance.store_tombstones: if self._test_instance.store_tombstones:
tombstones_url = None resolved_tombstones = tombstones.ResolveTombstones(
for result in results: device,
if result.GetType() == base_test_result.ResultType.CRASH: resolve_all_tombstones=True,
if not tombstones_url: include_stack_symbols=False,
resolved_tombstones = tombstones.ResolveTombstones( wipe_tombstones=True,
device, tombstone_symbolizer=self._test_instance.symbolizer)
resolve_all_tombstones=True, if resolved_tombstones:
include_stack_symbols=False, tombstone_filename = 'tombstones_%s_%s' % (time.strftime(
wipe_tombstones=True, '%Y%m%dT%H%M%S-UTC', time.gmtime()), device.serial)
tombstone_symbolizer=self._test_instance.symbolizer) with self._env.output_manager.ArchivedTempfile(
tombstone_filename = 'tombstones_%s_%s' % ( tombstone_filename, 'tombstones') as tombstone_file:
time.strftime('%Y%m%dT%H%M%S-UTC', time.gmtime()), tombstone_file.write('\n'.join(resolved_tombstones))
device.serial)
with self._env.output_manager.ArchivedTempfile( # Associate tombstones with first crashing test.
tombstone_filename, 'tombstones') as tombstone_file: for result in results:
tombstone_file.write('\n'.join(resolved_tombstones)) if result.GetType() == base_test_result.ResultType.CRASH:
result.SetLink('tombstones', tombstone_file.Link()) 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 return results, None
def _GetTestsFromRunner(self): 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