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

Unified Diff: build/android/emulator.py

Issue 9185043: Increase Android test robustness. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove 'ALWAYS' Created 8 years, 11 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 | « no previous file | build/android/run_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/emulator.py
diff --git a/build/android/emulator.py b/build/android/emulator.py
index 67adfb335674a6ad3e64f79427859736d4c52f3e..07f64bb8fabebcbcc322c169320459125137f936 100755
--- a/build/android/emulator.py
+++ b/build/android/emulator.py
@@ -92,7 +92,14 @@ class Emulator(object):
# Time to wait for a "wait for boot complete" (property set on device).
_WAITFORBOOT_TIMEOUT = 300
- def __init__(self):
+ def __init__(self, fast_and_loose=False):
+ """Init an Emulator.
+
+ Args:
+ fast_and_loose: Loosen up the rules for reliable running for speed.
+ Intended for quick testing or re-testing.
+
+ """
try:
android_sdk_root = os.environ['ANDROID_SDK_ROOT']
except KeyError:
@@ -102,6 +109,7 @@ class Emulator(object):
self.emulator = os.path.join(android_sdk_root, 'tools', 'emulator')
self.popen = None
self.device = None
+ self.fast_and_loose = fast_and_loose
def _DeviceName(self):
"""Return our device name."""
@@ -114,7 +122,8 @@ class Emulator(object):
If fails, an exception will be raised.
"""
_KillAllEmulators() # just to be sure
- self._AggressiveImageCleanup()
+ if not self.fast_and_loose:
+ self._AggressiveImageCleanup()
(self.device, port) = self._DeviceName()
emulator_command = [
self.emulator,
@@ -123,13 +132,16 @@ class Emulator(object):
# The default /data size is 64M.
# That's not enough for 4 unit test bundles and their data.
'-partition-size', '256',
- # ALWAYS wipe the data. We've seen cases where an emulator
- # gets 'stuck' if we don't do this (every thousand runs or
- # so).
- '-wipe-data',
# Use a familiar name and port.
'-avd', 'buildbot',
'-port', str(port)]
+ if not self.fast_and_loose:
+ emulator_command.extend([
+ # Wipe the data. We've seen cases where an emulator
+ # gets 'stuck' if we don't do this (every thousand runs or
+ # so).
+ '-wipe-data',
+ ])
logging.info('Emulator launch command: %s', ' '.join(emulator_command))
self.popen = subprocess.Popen(args=emulator_command,
stderr=subprocess.STDOUT)
« no previous file with comments | « no previous file | build/android/run_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698