| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import io | 5 import io |
| 6 import json | 6 import json |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import pickle | 9 import pickle |
| 10 import shutil | 10 import shutil |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 # Affinitize the tests. | 337 # Affinitize the tests. |
| 338 self._SplitTestsByAffinity() | 338 self._SplitTestsByAffinity() |
| 339 if not self._test_buckets: | 339 if not self._test_buckets: |
| 340 raise local_device_test_run.NoTestsError() | 340 raise local_device_test_run.NoTestsError() |
| 341 | 341 |
| 342 def run_perf_tests(shard_id): | 342 def run_perf_tests(shard_id): |
| 343 if device_status.IsBlacklisted( | 343 if device_status.IsBlacklisted( |
| 344 str(self._devices[shard_id]), self._env.blacklist): | 344 str(self._devices[shard_id]), self._env.blacklist): |
| 345 logging.warning('Device %s is not active. Will not create shard %s.', | 345 logging.warning('Device %s is not active. Will not create shard %s.', |
| 346 str(self._devices[shard_id]), shard_id) | 346 str(self._devices[shard_id]), shard_id) |
| 347 return [] | 347 return None |
| 348 s = TestShard(self._env, self._test_instance, self._devices[shard_id], | 348 s = TestShard(self._env, self._test_instance, self._devices[shard_id], |
| 349 shard_id, self._test_buckets[shard_id], | 349 shard_id, self._test_buckets[shard_id], |
| 350 retries=self._env.max_tries, timeout=self._timeout) | 350 retries=self._env.max_tries, timeout=self._timeout) |
| 351 return s.RunTestsOnShard() | 351 return s.RunTestsOnShard() |
| 352 | 352 |
| 353 device_indices = range(min(len(self._devices), len(self._test_buckets))) | 353 device_indices = range(min(len(self._devices), len(self._test_buckets))) |
| 354 shards = parallelizer.Parallelizer(device_indices).pMap(run_perf_tests) | 354 shards = parallelizer.Parallelizer(device_indices).pMap(run_perf_tests) |
| 355 return [x for x in shards.pGet(self._timeout) if x is not None] | 355 return [x for x in shards.pGet(self._timeout) if x is not None] |
| 356 | 356 |
| 357 # override | 357 # override |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 # override | 417 # override |
| 418 def _RunTest(self, _device, _test): | 418 def _RunTest(self, _device, _test): |
| 419 raise NotImplementedError | 419 raise NotImplementedError |
| 420 | 420 |
| 421 | 421 |
| 422 class TestDictVersionError(Exception): | 422 class TestDictVersionError(Exception): |
| 423 pass | 423 pass |
| 424 | 424 |
| 425 class PerfTestRunGetStepsError(Exception): | 425 class PerfTestRunGetStepsError(Exception): |
| 426 pass | 426 pass |
| OLD | NEW |