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

Unified Diff: build/android/pylib/local/device/local_device_gtest_run.py

Issue 1414093002: Android gtest runner: Add --enable-concurrent-adb flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable flag Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/local/device/local_device_environment.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 caef0548d2daf93f7dc392449f7d935df0851632..d37a5e8e34ce25e6327bc1a080f1417fc0a20bc1 100644
--- a/build/android/pylib/local/device/local_device_gtest_run.py
+++ b/build/android/pylib/local/device/local_device_gtest_run.py
@@ -10,6 +10,7 @@ import posixpath
from devil.android import device_errors
from devil.android import device_temp_file
from devil.android import ports
+from devil.utils import reraiser_thread
from incremental_install import installer
from pylib import constants
from pylib.gtest import gtest_test_instance
@@ -224,34 +225,43 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun):
#override
def SetUp(self):
-
@local_device_test_run.handle_shard_failures
- def individual_device_set_up(dev, host_device_tuples):
- # Install test APK.
- self._delegate.Install(dev, incremental=self._env.incremental_install)
-
- # Push data dependencies.
- external_storage = dev.GetExternalStoragePath()
- host_device_tuples = [
- (h, d if d is not None else external_storage)
- for h, d in host_device_tuples]
- dev.PushChangedFiles(host_device_tuples)
-
- tool = self.GetTool(dev)
- tool.CopyFiles(dev)
- tool.SetupEnvironment()
-
- self._servers[str(dev)] = []
- if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER:
- self._servers[str(dev)].append(
- local_test_server_spawner.LocalTestServerSpawner(
- ports.AllocateTestServerPort(), dev, tool))
-
- for s in self._servers[str(dev)]:
- s.SetUp()
-
- self._env.parallel_devices.pMap(individual_device_set_up,
- self._test_instance.GetDataDependencies())
+ def individual_device_set_up(dev):
+ def install_apk():
+ # Install test APK.
+ self._delegate.Install(dev, incremental=self._env.incremental_install)
+
+ def push_test_data():
+ # Push data dependencies.
+ external_storage = dev.GetExternalStoragePath()
+ data_deps = self._test_instance.GetDataDependencies()
+ host_device_tuples = [
+ (h, d if d is not None else external_storage)
+ for h, d in data_deps]
+ dev.PushChangedFiles(host_device_tuples)
+
+ def init_tool_and_start_servers():
+ tool = self.GetTool(dev)
+ tool.CopyFiles(dev)
+ tool.SetupEnvironment()
+
+ self._servers[str(dev)] = []
+ if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER:
+ self._servers[str(dev)].append(
+ local_test_server_spawner.LocalTestServerSpawner(
+ ports.AllocateTestServerPort(), dev, tool))
+
+ for s in self._servers[str(dev)]:
+ s.SetUp()
+
+ steps = (install_apk, push_test_data, init_tool_and_start_servers)
+ if self._env.concurrent_adb:
+ reraiser_thread.RunAsync(steps)
+ else:
+ for step in steps:
+ step()
+
+ self._env.parallel_devices.pMap(individual_device_set_up)
#override
def _ShouldShard(self):
« no previous file with comments | « build/android/pylib/local/device/local_device_environment.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698