Chromium Code Reviews| Index: build/android/pylib/run_java_tests.py |
| diff --git a/build/android/pylib/run_java_tests.py b/build/android/pylib/run_java_tests.py |
| index bf51bad943b928c03d309a37b975697f3285cddc..0f2c050805178b6afa6362e82e84a62541e31e90 100644 |
| --- a/build/android/pylib/run_java_tests.py |
| +++ b/build/android/pylib/run_java_tests.py |
| @@ -40,6 +40,8 @@ def _TestNameToExpectation(test_name): |
| return '.'.join(test_name.replace('#', '.').split('.')[-2:]) |
| +# TODO(jaydeepmehta): FilterTests should be moved to a common file for |
|
bulach
2012/10/15 19:31:55
ditto..
felipeg
2012/10/16 14:11:44
Done.
|
| +# all integration tests. |
| def FilterTests(test_names, pattern_list, inclusive): |
| """Filters |test_names| using a list of patterns. |
| @@ -130,8 +132,7 @@ class TestRunner(BaseTestRunner): |
| self.ports_to_forward = ports_to_forward |
| self.test_results = TestResults() |
| - # List of forwarders created by this instance of TestRunner. |
| - self.forwarders = [] |
| + self.forwarder = None |
| if self.coverage: |
| if os.path.exists(TestRunner._COVERAGE_MERGED_FILENAME): |
| @@ -270,26 +271,23 @@ class TestRunner(BaseTestRunner): |
| # We give different default value to launch HTTP server based on shard index |
| # because it may have race condition when multiple processes are trying to |
| # launch lighttpd with same port at same time. |
| - # This line *must* come before the forwarding below, as it nukes all |
| - # the other forwarders. A more comprehensive fix might be to pull the |
| - # forwarder-killing line up to here, but that might violate assumptions |
| - # implicit in other places. |
| - self.LaunchTestHttpServer(os.path.join(constants.CHROME_DIR), |
| - (constants.LIGHTTPD_RANDOM_PORT_FIRST + |
| - self.shard_index)) |
| - |
| + http_server_ports = self.LaunchTestHttpServer( |
| + os.path.join(constants.CHROME_DIR), |
| + (constants.LIGHTTPD_RANDOM_PORT_FIRST + self.shard_index)) |
| if self.ports_to_forward: |
| - for port in self.ports_to_forward: |
| - self.forwarders.append(Forwarder( |
| - self.adb, [(port, port)], self.tool, '127.0.0.1', self.build_type)) |
| + port_pairs = [(port, port) for port in self.ports_to_forward] |
| + # We need to remember which ports the HTTP server is using, since the |
| + # forwarder will stomp on them otherwise. |
| + port_pairs.append(http_server_ports) |
| + self.forwarder = Forwarder( |
| + self.adb, port_pairs, self.tool, '127.0.0.1', self.build_type) |
| self.CopyTestFilesOnce() |
| self.flags.AddFlags(['--enable-test-intents']) |
| def TearDown(self): |
| """Cleans up the test harness and saves outstanding data from test run.""" |
| - if self.forwarders: |
| - for forwarder in self.forwarders: |
| - forwarder.Close() |
| + if self.forwarder: |
| + self.forwarder.Close() |
| self.GenerateCoverageReportIfNeeded() |
| super(TestRunner, self).TearDown() |
| @@ -363,6 +361,7 @@ class TestRunner(BaseTestRunner): |
| raw_test_name = test.split('#')[1] |
| # Wait and grab annotation data so we can figure out which traces to parse |
| + # TODO(tonyg): Is there an error log line to watch for here? |
|
bulach
2012/10/15 19:31:55
ditto..
felipeg
2012/10/16 14:11:44
Done.
|
| regex = self.adb.WaitForLogMatch(re.compile('\*\*PERFANNOTATION\(' + |
| raw_test_name + |
| '\)\:(.*)'), None) |