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

Unified Diff: build/android/pylib/local/device/local_device_gtest_run.py

Issue 1703863003: Created separate shards for suspicious testcases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
Index: build/android/pylib/local/device/local_device_gtest_run.py
diff --git a/build/android/pylib/local/device/local_device_gtest_run.py b/build/android/pylib/local/device/local_device_gtest_run.py
index e740f564a23cdb8cb8c52aac216b99421a1d977d..bfb59c6a4b1fbab2ba63421ce4f8545f628bedf4 100644
--- a/build/android/pylib/local/device/local_device_gtest_run.py
+++ b/build/android/pylib/local/device/local_device_gtest_run.py
@@ -282,9 +282,19 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun):
return True
#override
- def _CreateShards(self, tests):
+ def _CreateShards(self, tests, suspects = []):
+ # Suspects are tests that might crash and make the tests in the same shard
+ # following the supect not run. Thus we need to create separate shards for
+ # each suspects, so that other tests can be run.
device_count = len(self._env.devices)
shards = []
+
+ # Add shards with only one suspect testcase.
+ shards += [[suspect] for suspect in suspects]
+
+ # Delete suspect testcase from tests.
+ tests = [test for test in tests if not test in suspects]
+
for i in xrange(0, device_count):
unbounded_shard = tests[i::device_count]
shards += [unbounded_shard[j:j+_MAX_SHARD_SIZE]

Powered by Google App Engine
This is Rietveld 408576698