Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: build/android/pylib/host_driven/python_test_sharder.py

Issue 20824008: Reland r212020: Move Python setup/tear down logic into Forwarder ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Close unused FDs Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android/pylib/forwarder.py ('k') | build/android/pylib/instrumentation/test_runner.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Takes care of sharding the python-drive tests in multiple devices.""" 5 """Takes care of sharding the python-drive tests in multiple devices."""
6 6
7 import copy 7 import copy
8 import logging 8 import logging
9 import multiprocessing 9 import multiprocessing
10 10
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 """ 115 """
116 logging.warning('*' * 80) 116 logging.warning('*' * 80)
117 logging.warning('Sharding in ' + str(len(self.attached_devices)) + 117 logging.warning('Sharding in ' + str(len(self.attached_devices)) +
118 ' devices.') 118 ' devices.')
119 logging.warning('Note that the output is not synchronized.') 119 logging.warning('Note that the output is not synchronized.')
120 logging.warning('Look for the "Final result" banner in the end.') 120 logging.warning('Look for the "Final result" banner in the end.')
121 logging.warning('*' * 80) 121 logging.warning('*' * 80)
122 final_results = base_test_result.TestRunResults() 122 final_results = base_test_result.TestRunResults()
123 tests_to_run = self.tests 123 tests_to_run = self.tests
124 124
125 Forwarder.KillHost() 125 Forwarder.UseMultiprocessing()
126 126
127 for retry in xrange(self.retries): 127 for retry in xrange(self.retries):
128 logging.warning('Try %d of %d', retry + 1, self.retries) 128 logging.warning('Try %d of %d', retry + 1, self.retries)
129 self._SetupSharding(self.tests) 129 self._SetupSharding(self.tests)
130 test_runners = self._MakeTestRunners(self.attached_devices) 130 test_runners = self._MakeTestRunners(self.attached_devices)
131 logging.warning('Starting...') 131 logging.warning('Starting...')
132 pool = multiprocessing.Pool(len(self.attached_devices), 132 pool = multiprocessing.Pool(len(self.attached_devices),
133 SetTestsContainer, 133 SetTestsContainer,
134 [PythonTestSharder.tests_container]) 134 [PythonTestSharder.tests_container])
135 135
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 available_tests: a list of tests which subclass PythonTestBase. 194 available_tests: a list of tests which subclass PythonTestBase.
195 failed_test_names: a list of failed test names. 195 failed_test_names: a list of failed test names.
196 196
197 Returns: 197 Returns:
198 A list of test objects which correspond to test names found in 198 A list of test objects which correspond to test names found in
199 failed_test_names, or an empty list if there is no correspondence. 199 failed_test_names, or an empty list if there is no correspondence.
200 """ 200 """
201 tests_to_retry = [t for t in available_tests 201 tests_to_retry = [t for t in available_tests
202 if t.qualified_name in failed_test_names] 202 if t.qualified_name in failed_test_names]
203 return tests_to_retry 203 return tests_to_retry
OLDNEW
« no previous file with comments | « build/android/pylib/forwarder.py ('k') | build/android/pylib/instrumentation/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698