Chromium Code Reviews| 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..090e5838a5c423608fbbf83ca4d84da15eda2ddb 100644 |
| --- a/build/android/pylib/local/device/local_device_gtest_run.py |
| +++ b/build/android/pylib/local/device/local_device_gtest_run.py |
| @@ -229,7 +229,7 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun): |
| self._delegate = _ApkDelegate(self._test_instance) |
| elif self._test_instance.exe: |
| self._delegate = _ExeDelegate(self, self._test_instance.exe) |
| - |
| + self.suspects = set() |
|
jbudorick
2016/02/27 00:31:38
suspects here should probably be _suspects
BigBossZhiling
2016/02/29 22:19:28
Done.
|
| self._servers = collections.defaultdict(list) |
| #override |
| @@ -283,8 +283,18 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun): |
| #override |
| def _CreateShards(self, tests): |
| + # 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. |
|
jbudorick
2016/02/27 00:31:38
nit: suspect
BigBossZhiling
2016/02/29 22:19:28
Done.
|
| device_count = len(self._env.devices) |
| shards = [] |
| + |
| + # Add shards with only one suspect testcase. |
| + shards += [[suspect] for suspect in self.suspects if suspect in tests] |
|
jbudorick
2016/02/27 00:31:38
will suspect ever not be in tests...?
BigBossZhiling
2016/02/29 22:19:27
I am not sure. Is there a case where multiple test
|
| + |
| + # Delete suspect testcase from tests. |
| + tests = [test for test in tests if not test in self.suspects] |
| + |
| for i in xrange(0, device_count): |
| unbounded_shard = tests[i::device_count] |
| shards += [unbounded_shard[j:j+_MAX_SHARD_SIZE] |
| @@ -337,6 +347,9 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun): |
| # Parse the output. |
| # TODO(jbudorick): Transition test scripts away from parsing stdout. |
| + crashed_test_case = self._test_instance.GetCrashedTestCase(output) |
| + if crashed_test_case: |
| + self.suspects.add(crashed_test_case) |
| results = self._test_instance.ParseGTestOutput(output) |
|
jbudorick
2016/02/27 00:31:38
What if we did crash parsing in ParseGTestOutput a
|
| return results |