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..121f351a1cfcd039cbce15cb84a13a3d375fe8e1 100644 |
| --- a/build/android/pylib/local/device/local_device_gtest_run.py |
| +++ b/build/android/pylib/local/device/local_device_gtest_run.py |
| @@ -315,6 +315,14 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun): |
| # Query all devices in case one fails. |
| test_lists = self._env.parallel_devices.pMap(list_tests).pGet(None) |
| + |
| + # If all devices failed to list_tests, raise an exception. |
| + check_one_device_failed = lambda result: result == None |
| + check_both_devices_failed = lambda device_x_failed, device_y_failed: device_x_failed and device_y_failed |
| + if reduce(check_both_devices_failed, map(check_one_device_failed, test_lists)): |
|
mikecase (-- gone --)
2016/02/19 19:03:42
You could just do "if all(map(check_one_device_fai
BigBossZhiling
2016/02/19 22:13:47
Done.
|
| + # Now we know that all devices failed to do list_tests. |
| + raise Exception('Failed to list tests on all devices') |
|
mikecase (-- gone --)
2016/02/19 19:03:42
Look around in devil/android/device_errors.py for
BigBossZhiling
2016/02/19 22:13:47
Done.
|
| + |
| # TODO(agrieve): Make this fail rather than return an empty list when |
| # all devices fail. |
|
mikecase (-- gone --)
2016/02/19 19:03:42
nit: Remove this TODO.
|
| return list(sorted(set().union(*[set(tl) for tl in test_lists if tl]))) |