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

Unified Diff: build/android/pylib/instrumentation/test_runner.py

Issue 701943002: hack to repeat instrumentation test until failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refs/heads/master@{#341335} Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/test_runner.py
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py
index 0f2e53fea733e032314bf5cee7ccd6d711e3df3b..82a093cffca8722609fdb7b6aeb62583cd2545d4 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -341,27 +341,30 @@ class TestRunner(base_test_runner.BaseTestRunner):
start_ms = 0
duration_ms = 0
try:
- self.TestSetup(test)
-
- try:
- self.device.GoHome()
- except device_errors.CommandTimeoutError:
- logging.exception('Failed to focus the launcher.')
-
- time_ms = lambda: int(time.time() * 1000)
- start_ms = time_ms()
- raw_output = self._RunTest(test, timeout)
- duration_ms = time_ms() - start_ms
-
- # Parse the test output
- result_code, result_bundle, statuses = (
- instrumentation_test_instance.ParseAmInstrumentRawOutput(raw_output))
- result = self._GenerateTestResult(
- test, result_code, result_bundle, statuses, start_ms, duration_ms)
- if local_device_instrumentation_test_run.DidPackageCrashOnDevice(
- self.test_pkg.GetPackageName(), self.device):
- result.SetType(base_test_result.ResultType.CRASH)
- results.AddResult(result)
+ while True:
+ self.TestSetup(test)
+
+ try:
+ self.device.GoHome()
+ except device_errors.CommandTimeoutError:
+ logging.exception('Failed to focus the launcher.')
+
+ time_ms = lambda: int(time.time() * 1000)
+ start_ms = time_ms()
+ raw_output = self._RunTest(test, timeout)
+ duration_ms = time_ms() - start_ms
+
+ # Parse the test output
+ result_code, result_bundle, statuses = (
+ instrumentation_test_instance.ParseAmInstrumentRawOutput(raw_output))
+ result = self._GenerateTestResult(
+ test, result_code, result_bundle, statuses, start_ms, duration_ms)
+ if local_device_instrumentation_test_run.DidPackageCrashOnDevice(
+ self.test_pkg.GetPackageName(), self.device):
+ result.SetType(base_test_result.ResultType.CRASH)
+ results.AddResult(result)
+ if result.GetType() not in [base_test_result.ResultType.PASS, base_test_result.ResultType.SKIP]:
+ break
except device_errors.CommandTimeoutError as e:
results.AddResult(test_result.InstrumentationTestResult(
test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698