summaryrefslogtreecommitdiffstats
path: root/build/android/run_tests.py
diff options
context:
space:
mode:
authorjrg@google.com <jrg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 22:09:03 +0000
committerjrg@google.com <jrg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 22:09:03 +0000
commit3276041925cec5ad27ab6b57d86715c259f4a5ca (patch)
tree36af07e78a126c15218f3150014bad75287c3b5c /build/android/run_tests.py
parent0a9298b6333f5a373ddd316978f0aa469ef20ce7 (diff)
downloadchromium_src-3276041925cec5ad27ab6b57d86715c259f4a5ca.zip
chromium_src-3276041925cec5ad27ab6b57d86715c259f4a5ca.tar.gz
chromium_src-3276041925cec5ad27ab6b57d86715c259f4a5ca.tar.bz2
Android bot changes for robustness, profiling, and debugging.
Kill all emulators before starting a test to be more robust on error. Print error if a file fails to copy to the device. Speed up emulator launch by 40%. Increase emulator partition size to fix 'out of space on device' errors. Log emulator launch time to help profile bot costs. Run tests in verbose mode to assist with bot debugging. BUG=None TEST= Review URL: http://codereview.chromium.org/8769020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112552 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android/run_tests.py')
-rwxr-xr-xbuild/android/run_tests.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/build/android/run_tests.py b/build/android/run_tests.py
index 19e1672..61b01d7 100755
--- a/build/android/run_tests.py
+++ b/build/android/run_tests.py
@@ -65,6 +65,25 @@ from test_result import BaseTestResult, TestResults
_TEST_SUITES = ['base_unittests', 'sql_unittests', 'ipc_tests', 'net_unittests']
+
+class TimeProfile(object):
+ """Class for simple profiling of action, with logging of cost."""
+
+ def __init__(self, description):
+ self._description = description
+ self.Start()
+
+ def Start(self):
+ self._starttime = time.time()
+
+ def Stop(self):
+ """Stop profiling and dump a log."""
+ if self._starttime:
+ stoptime = time.time()
+ logging.info('%fsec to perform %s' %
+ (stoptime - self._starttime, self._description))
+ self._starttime = None
+
class Xvfb(object):
"""Class to start and stop Xvfb if relevant. Nop if not Linux."""
@@ -194,8 +213,11 @@ def Dispatch(options):
xvfb.Start()
if options.use_emulator:
+ t = TimeProfile('Emulator launch')
buildbot_emulator = emulator.Emulator()
+ buildbot_emulator.Reset()
buildbot_emulator.Launch()
+ t.Stop()
attached_devices.append(buildbot_emulator.device)
else:
attached_devices = android_commands.GetAttachedDevices()