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

Unified Diff: build/android/pylib/base_test_sharder.py

Issue 11232037: Retry tests on other bots if the device is unresponsive/offline (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: small improvement Created 8 years, 2 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 | « build/android/pylib/android_commands.py ('k') | build/android/pylib/single_test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/base_test_sharder.py
diff --git a/build/android/pylib/base_test_sharder.py b/build/android/pylib/base_test_sharder.py
index 48206c202ce1774a402da8bbc98f2aa9a5269491..5306769155050ba032364650daeecaa1581e609b 100644
--- a/build/android/pylib/base_test_sharder.py
+++ b/build/android/pylib/base_test_sharder.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
+import android_commands
import logging
import multiprocessing
@@ -96,8 +97,17 @@ class BaseTestSharder(object):
# So use map_async instead.
async_results = pool.map_async(_ShardedTestRunnable, test_runners)
results_lists = async_results.get(999999)
+
test_results = TestResults.FromTestResults(results_lists)
- if retry == self.retries - 1:
+ # Re-check the attached devices for some devices may
+ # become offline
+ retry_devices = set(android_commands.GetAttachedDevices())
+ # Remove devices that had exceptions.
+ retry_devices -= TestResults.DeviceExceptions(results_lists)
+ # Retry on devices that didn't have any exception.
+ self.attached_devices = list(retry_devices)
+ if (retry == self.retries - 1 or
+ len(self.attached_devices) == 0):
all_passed = final_results.ok + test_results.ok
final_results = test_results
final_results.ok = all_passed
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | build/android/pylib/single_test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698