Bug 809437 - Stop b2g process before installing gecko into an emulator, r=jgriffin
☠☠ backed out by 1ab2043a4669 ☠ ☠
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 07 Nov 2012 15:55:01 -0800
changeset 112638 b9ec1725a5e2b0e6f58b5081c681d77cad6b1815
parent 112637 222f4185ecb56970684e04adcb3237f0065b4b3c
child 112639 d941ad65a09ed6300940f175892a7845f518ad0e
push id23833
push useremorley@mozilla.com
push dateThu, 08 Nov 2012 10:20:57 +0000
treeherdermozilla-central@e0d7b394462b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs809437
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 809437 - Stop b2g process before installing gecko into an emulator, r=jgriffin
testing/marionette/client/marionette/emulator.py
--- a/testing/marionette/client/marionette/emulator.py
+++ b/testing/marionette/client/marionette/emulator.py
@@ -382,38 +382,39 @@ waitFor(
         # gecko in order to avoid an adb bug in which adb will sometimes
         # hang indefinitely while copying large files to the system
         # partition.
         push_attempts = 10
 
         print 'installing gecko binaries...'
         # need to remount so we can write to /system/b2g
         self._run_adb(['remount'])
+        self.dm.shellCheckOutput(['stop', 'b2g'])
+        # ensure the b2g process has fully stopped (bug 809437)
+        for i in range(0, 10):
+            time.sleep(1)
+            if self.dm.processExist('b2g') is None:
+                break
+        else:
+            raise TimeoutException("Timeout waiting for the b2g process to terminate")
+
         for root, dirs, files in os.walk(gecko_path):
             for filename in files:
                 rel_path = os.path.relpath(os.path.join(root, filename), gecko_path)
                 system_b2g_file = os.path.join('/system/b2g', rel_path)
                 for retry in range(1, push_attempts+1):
                     print 'pushing', system_b2g_file, '(attempt %s of %s)' % (retry, push_attempts)
                     try:
                         self.dm.pushFile(os.path.join(root, filename), system_b2g_file)
                         break
                     except DMError:
                         if retry == push_attempts:
                             raise
 
         print 'restarting B2G'
-        self.dm.shellCheckOutput(['stop', 'b2g'])
-        # ensure the b2g process has fully stopped (bug 809437)
-        for i in range(0, 10):
-            time.sleep(1)
-            if self.dm.processExist('b2g') is None:
-                break
-        else:
-            raise TimeoutException("Timeout waiting for the b2g process to terminate")
         self.dm.shellCheckOutput(['start', 'b2g'])
 
         if not self.wait_for_port():
             raise TimeoutException("Timeout waiting for marionette on port '%s'" % self.marionette_port)
         self.wait_for_system_message(marionette)
 
     def rotate_log(self, srclog, index=1):
         """ Rotate a logfile, by recursively rotating logs further in the sequence,