Skip to content

Commit

Permalink
Android: Capture more tombstones in instrumentation tests
Browse files Browse the repository at this point in the history
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/+/2363075
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799490}
  • Loading branch information
agrieve authored and Commit Bot committed Aug 19, 2020
1 parent 2bcca8f commit e384305
Showing 1 changed file with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -783,24 +783,30 @@ def stop_chrome_proxy():
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):
Expand Down

0 comments on commit e384305

Please sign in to comment.