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

Side by Side Diff: build/android/pylib/instrumentation/test_runner.py

Issue 376873008: Improve Android Test Size Annotation support in test_runner.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reduce timeout to 10m Created 6 years, 5 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 | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/RepostFormWarningTest.java » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Class for running instrumentation tests on a single device.""" 5 """Class for running instrumentation tests on a single device."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 if scale_match: 312 if scale_match:
313 timeout_scale = int(scale_match.group(1)) 313 timeout_scale = int(scale_match.group(1))
314 if self.options.wait_for_debugger: 314 if self.options.wait_for_debugger:
315 timeout_scale *= 100 315 timeout_scale *= 100
316 return timeout_scale 316 return timeout_scale
317 317
318 def _GetIndividualTestTimeoutSecs(self, test): 318 def _GetIndividualTestTimeoutSecs(self, test):
319 """Returns the timeout in seconds for the given |test|.""" 319 """Returns the timeout in seconds for the given |test|."""
320 annotations = self.test_pkg.GetTestAnnotations(test) 320 annotations = self.test_pkg.GetTestAnnotations(test)
321 if 'Manual' in annotations: 321 if 'Manual' in annotations:
322 return 600 * 60 322 return 10 * 60 * 60
323 if 'External' in annotations: 323 if 'External' in annotations:
324 return 10 * 60 324 return 10 * 60
325 if 'EnormousTest' in annotations:
326 return 10 * 60
325 if 'LargeTest' in annotations or _PERF_TEST_ANNOTATION in annotations: 327 if 'LargeTest' in annotations or _PERF_TEST_ANNOTATION in annotations:
326 return 5 * 60 328 return 5 * 60
327 if 'MediumTest' in annotations: 329 if 'MediumTest' in annotations:
328 return 3 * 60 330 return 3 * 60
331 if 'SmallTest' in annotations:
332 return 1 * 60
333
334 logging.warn(("Test size not found in annotations for test '{0}', using " +
335 "1 minute for timeout.").format(test))
329 return 1 * 60 336 return 1 * 60
330 337
331 def _RunTest(self, test, timeout): 338 def _RunTest(self, test, timeout):
332 try: 339 try:
333 return self.device.old_interface.RunInstrumentationTest( 340 return self.device.old_interface.RunInstrumentationTest(
334 test, self.test_pkg.GetPackageName(), 341 test, self.test_pkg.GetPackageName(),
335 self._GetInstrumentationArgs(), timeout) 342 self._GetInstrumentationArgs(), timeout)
336 except (device_errors.CommandTimeoutError, 343 except (device_errors.CommandTimeoutError,
337 # TODO(jbudorick) Remove this once the underlying implementations 344 # TODO(jbudorick) Remove this once the underlying implementations
338 # for the above are switched or wrapped. 345 # for the above are switched or wrapped.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 duration_ms = 0 394 duration_ms = 0
388 message = str(e) 395 message = str(e)
389 if not message: 396 if not message:
390 message = 'No information.' 397 message = 'No information.'
391 results.AddResult(test_result.InstrumentationTestResult( 398 results.AddResult(test_result.InstrumentationTestResult(
392 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms, 399 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms,
393 log=message)) 400 log=message))
394 raw_result = None 401 raw_result = None
395 self.TestTeardown(test, raw_result) 402 self.TestTeardown(test, raw_result)
396 return (results, None if results.DidRunPass() else test) 403 return (results, None if results.DidRunPass() else test)
OLDNEW
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/RepostFormWarningTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698