Index: build/android/pylib/single_test_runner.py |
diff --git a/build/android/pylib/single_test_runner.py b/build/android/pylib/single_test_runner.py |
index 48e92ea3d6cec24f2d59731b4057a7c807c00b94..e3b6d87a3b3eef5b14803f4c96a6c7a2ba8ffb87 100644 |
--- a/build/android/pylib/single_test_runner.py |
+++ b/build/android/pylib/single_test_runner.py |
@@ -13,6 +13,11 @@ from test_package_apk import TestPackageApk |
from test_package_executable import TestPackageExecutable |
from test_result import TestResults |
+# adb_interface.py is under ../../third_party/android_testrunner/ |
+sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', |
+ '..', 'third_party', 'android_testrunner')) |
+import run_command |
+ |
class SingleTestRunner(BaseTestRunner): |
"""Single test suite attached to a single device. |
@@ -292,6 +297,11 @@ class SingleTestRunner(BaseTestRunner): |
def SetUp(self): |
"""Sets up necessary test enviroment for the test suite.""" |
super(SingleTestRunner, self).SetUp() |
+ # Sometimes adb server may crash and the connection to the device lost, |
+ # which will block the test. So kill the server each time the test starts |
+ # and the connection to the device will be re-established. |
+ run_command.RunCommand('adb kill-server') |
John Grabowski
2012/07/10 06:14:09
prefer self.adb.SomethingOrOther() to a 'run comma
Wei James(wistoch)
2012/07/10 14:26:48
fixed.
define Start/Kill/RestartAdbServer in adb
|
+ |
if self.test_package.performance_test: |
if run_tests_helper.IsRunningAsBuildbot(): |
self.adb.SetJavaAssertsEnabled(enable=False) |