Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: build/android/pylib/local/device/local_device_instrumentation_test_run.py

Issue 2201833002: Added tombstones in instrumentation tests results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/pylib/instrumentation/test_result.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 import os 6 import os
7 import posixpath 7 import posixpath
8 import re 8 import re
9 import sys
9 import time 10 import time
10 11
11 from devil.android import device_errors 12 from devil.android import device_errors
12 from devil.android import flag_changer 13 from devil.android import flag_changer
13 from devil.utils import reraiser_thread 14 from devil.utils import reraiser_thread
14 from pylib import valgrind_tools 15 from pylib import valgrind_tools
15 from pylib.base import base_test_result 16 from pylib.base import base_test_result
16 from pylib.local.device import local_device_environment 17 from pylib.local.device import local_device_environment
17 from pylib.local.device import local_device_test_run 18 from pylib.local.device import local_device_test_run
18 19
20 from pylib.constants import host_paths
21 sys.path.append(os.path.join(host_paths.DIR_SOURCE_ROOT, 'build', 'android'))
22 import tombstones
23
19 24
20 TIMEOUT_ANNOTATIONS = [ 25 TIMEOUT_ANNOTATIONS = [
21 ('Manual', 10 * 60 * 60), 26 ('Manual', 10 * 60 * 60),
22 ('IntegrationTest', 30 * 60), 27 ('IntegrationTest', 30 * 60),
23 ('External', 10 * 60), 28 ('External', 10 * 60),
24 ('EnormousTest', 10 * 60), 29 ('EnormousTest', 10 * 60),
25 ('LargeTest', 5 * 60), 30 ('LargeTest', 5 * 60),
26 ('MediumTest', 3 * 60), 31 ('MediumTest', 3 * 60),
27 ('SmallTest', 1 * 60), 32 ('SmallTest', 1 * 60),
28 ] 33 ]
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 141
137 valgrind_tools.SetChromeTimeoutScale( 142 valgrind_tools.SetChromeTimeoutScale(
138 dev, self._test_instance.timeout_scale) 143 dev, self._test_instance.timeout_scale)
139 144
140 steps = (install_apk, push_test_data, create_flag_changer) 145 steps = (install_apk, push_test_data, create_flag_changer)
141 if self._env.concurrent_adb: 146 if self._env.concurrent_adb:
142 reraiser_thread.RunAsync(steps) 147 reraiser_thread.RunAsync(steps)
143 else: 148 else:
144 for step in steps: 149 for step in steps:
145 step() 150 step()
151 if self._test_instance.store_tombstones:
152 tombstones.ClearAllTombstones(dev)
mikecase (-- gone --) 2016/08/04 01:12:05 There is a recipe step on our infrastructure that
BigBossZhiling 2016/08/04 23:20:28 Acknowledged.
146 153
147 self._env.parallel_devices.pMap( 154 self._env.parallel_devices.pMap(
148 individual_device_set_up, 155 individual_device_set_up,
149 self._test_instance.GetDataDependencies()) 156 self._test_instance.GetDataDependencies())
150 157
151 def TearDown(self): 158 def TearDown(self):
152 @local_device_environment.handle_shard_failures_with( 159 @local_device_environment.handle_shard_failures_with(
153 self._env.BlacklistDevice) 160 self._env.BlacklistDevice)
154 def individual_device_tear_down(dev): 161 def individual_device_tear_down(dev):
155 if str(dev) in self._flag_changers: 162 if str(dev) in self._flag_changers:
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 329
323 else: 330 else:
324 logging.debug('raw output from %s:', test_display_name) 331 logging.debug('raw output from %s:', test_display_name)
325 for l in output: 332 for l in output:
326 logging.debug(' %s', l) 333 logging.debug(' %s', l)
327 if self._test_instance.coverage_directory: 334 if self._test_instance.coverage_directory:
328 device.PullFile(coverage_directory, 335 device.PullFile(coverage_directory,
329 self._test_instance.coverage_directory) 336 self._test_instance.coverage_directory)
330 device.RunShellCommand('rm -f %s' % os.path.join(coverage_directory, 337 device.RunShellCommand('rm -f %s' % os.path.join(coverage_directory,
331 '*')) 338 '*'))
339 if self._test_instance.store_tombstones:
340 for result in results:
341 if result.GetType() == base_test_result.ResultType.FAIL:
342 tombstones.ResolveTombstones(
343 device,
mikecase (-- gone --) 2016/08/04 01:12:05 nit: wrong indent. Need 4 spaces.
BigBossZhiling 2016/08/04 23:20:28 Done.
344 resolve_all_tombstones=True,
345 include_stack_symbols=False,
346 wipe_tombstones=True)
347 result.SetTombstones(tombstones)
mikecase (-- gone --) 2016/08/04 01:12:05 So, Im not too sure what tombstones really are to
BigBossZhiling 2016/08/04 23:20:28 What are death tests? I think if a test crashes, t
332 return results 348 return results
333 349
334 #override 350 #override
335 def _ShouldRetry(self, test): 351 def _ShouldRetry(self, test):
336 if 'RetryOnFailure' in test.get('annotations', {}): 352 if 'RetryOnFailure' in test.get('annotations', {}):
337 return True 353 return True
338 354
339 # TODO(jbudorick): Remove this log message and switch the return value to 355 # TODO(jbudorick): Remove this log message and switch the return value to
340 # False after tests have been annotated with @RetryOnFailure. 356 # False after tests have been annotated with @RetryOnFailure.
341 # See crbug.com/619055 for more details. 357 # See crbug.com/619055 for more details.
(...skipping 19 matching lines...) Expand all
361 timeout = v 377 timeout = v
362 break 378 break
363 else: 379 else:
364 logging.warning('Using default 1 minute timeout for %s', test_name) 380 logging.warning('Using default 1 minute timeout for %s', test_name)
365 timeout = 60 381 timeout = 60
366 382
367 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) 383 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations)
368 384
369 return timeout 385 return timeout
370 386
OLDNEW
« no previous file with comments | « build/android/pylib/instrumentation/test_result.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698