Partial revert of crrev.com/172937.
Add back the logic of dropping devices of we fail to get gtest lists. BUG= Review URL: https://codereview.chromium.org/11573038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173217 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@@ -189,21 +189,28 @@ class TestSharder(BaseTestSharder):
|
|||||||
self.all_tests = []
|
self.all_tests = []
|
||||||
if not self.gtest_filter:
|
if not self.gtest_filter:
|
||||||
# No filter has been specified, let's add all tests then.
|
# No filter has been specified, let's add all tests then.
|
||||||
self.all_tests = self._GetAllEnabledTests()
|
self.all_tests, self.attached_devices = self._GetAllEnabledTests()
|
||||||
self.tests = self.all_tests
|
self.tests = self.all_tests
|
||||||
|
|
||||||
def _GetAllEnabledTests(self):
|
def _GetAllEnabledTests(self):
|
||||||
"""Returns a list of all enabled tests.
|
"""Get all enabled tests and available devices.
|
||||||
|
|
||||||
Obtains a list of enabled tests from the test package on the device,
|
Obtains a list of enabled tests from the test package on the device,
|
||||||
then filters it again using the diabled list on the host.
|
then filters it again using the diabled list on the host.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Tuple of (all enabled tests, available devices).
|
||||||
|
|
||||||
Raises Exception if all devices failed.
|
Raises Exception if all devices failed.
|
||||||
"""
|
"""
|
||||||
|
# TODO(frankf): This method is doing too much in a non-systematic way.
|
||||||
|
# If the intention is to drop flaky devices, why not go through all devices
|
||||||
|
# instead of breaking on the first succesfull run?
|
||||||
available_devices = list(self.attached_devices)
|
available_devices = list(self.attached_devices)
|
||||||
while available_devices:
|
while available_devices:
|
||||||
try:
|
try:
|
||||||
return self._GetTestsFromDevice(available_devices[-1])
|
return (self._GetTestsFromDevice(available_devices[-1]),
|
||||||
|
available_devices)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.warning('Failed obtaining tests from %s %s',
|
logging.warning('Failed obtaining tests from %s %s',
|
||||||
available_devices[-1], e)
|
available_devices[-1], e)
|
||||||
|
Reference in New Issue
Block a user