OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Dispatches tests, either sharding or replicating them. | 5 """Dispatches tests, either sharding or replicating them. |
6 | 6 |
7 Performs the following steps: | 7 Performs the following steps: |
8 * Create a test collection factory, using the given tests | 8 * Create a test collection factory, using the given tests |
9 - If sharding: test collection factory returns the same shared test collection | 9 - If sharding: test collection factory returns the same shared test collection |
10 to all test runners | 10 to all test runners |
11 - If replciating: test collection factory returns a unique test collection to | 11 - If replciating: test collection factory returns a unique test collection to |
12 each test runner, with the same set of tests in each. | 12 each test runner, with the same set of tests in each. |
13 * Create a test runner for each device. | 13 * Create a test runner for each device. |
14 * Run each test runner in its own thread, grabbing tests from the test | 14 * Run each test runner in its own thread, grabbing tests from the test |
15 collection until there are no tests left. | 15 collection until there are no tests left. |
16 """ | 16 """ |
17 | 17 |
| 18 # TODO(jbudorick) Deprecate and remove this class after any relevant parts have |
| 19 # been ported to the new environment / test instance model. |
| 20 |
18 import logging | 21 import logging |
19 import threading | 22 import threading |
20 | 23 |
21 from pylib import android_commands | 24 from pylib import android_commands |
22 from pylib import constants | 25 from pylib import constants |
23 from pylib.base import base_test_result | 26 from pylib.base import base_test_result |
24 from pylib.device import device_errors | 27 from pylib.device import device_errors |
25 from pylib.utils import reraiser_thread | 28 from pylib.utils import reraiser_thread |
26 from pylib.utils import watchdog_timer | 29 from pylib.utils import watchdog_timer |
27 | 30 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 finally: | 407 finally: |
405 try: | 408 try: |
406 _TearDownRunners(runners, setup_timeout) | 409 _TearDownRunners(runners, setup_timeout) |
407 except (device_errors.DeviceUnreachableError, | 410 except (device_errors.DeviceUnreachableError, |
408 # TODO(jbudorick) Remove this once the underlying implementations | 411 # TODO(jbudorick) Remove this once the underlying implementations |
409 # for the above are switched or wrapped. | 412 # for the above are switched or wrapped. |
410 android_commands.errors.DeviceUnresponsiveError) as e: | 413 android_commands.errors.DeviceUnresponsiveError) as e: |
411 logging.warning('Device unresponsive during TearDown: [%s]', e) | 414 logging.warning('Device unresponsive during TearDown: [%s]', e) |
412 except Exception as e: | 415 except Exception as e: |
413 logging.error('Unexpected exception caught during TearDown: %s' % str(e)) | 416 logging.error('Unexpected exception caught during TearDown: %s' % str(e)) |
OLD | NEW |