Title: [135552] trunk/Tools
Revision
135552
Author
[email protected]
Date
2012-11-22 18:38:54 -0800 (Thu, 22 Nov 2012)

Log Message

[Chromium] Return an accurate exit code when running Android suites, and wait after restarting adb as root
https://bugs.webkit.org/show_bug.cgi?id=103065

Reviewed by Dirk Pranke.

This addresses two further reliability issues in the Android test running
scripts. Firstly, the run_tests.py script needs to have the --exit_code
argument passed in order to return non-zero codes, which we need for the
build master to distinguish failures from successful runs.

Secondly, it modifies the layout test runner to briefly wait (through
the wait-for-device command) after requesting a device to switch to root
mode. Without this waiting period, commands might get lost and thereby
unexpectedly fail.

* Scripts/run-api-tests:
* Scripts/run-chromium-webkit-unit-tests:
* Scripts/webkitpy/layout_tests/port/chromium_android.py:
(ChromiumAndroidDriver._setup_test):
(ChromiumAndroidDriver._restart_adb_as_root):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (135551 => 135552)


--- trunk/Tools/ChangeLog	2012-11-23 01:53:02 UTC (rev 135551)
+++ trunk/Tools/ChangeLog	2012-11-23 02:38:54 UTC (rev 135552)
@@ -1,3 +1,26 @@
+2012-11-22  Peter Beverloo  <[email protected]>
+
+        [Chromium] Return an accurate exit code when running Android suites, and wait after restarting adb as root
+        https://bugs.webkit.org/show_bug.cgi?id=103065
+
+        Reviewed by Dirk Pranke.
+
+        This addresses two further reliability issues in the Android test running
+        scripts. Firstly, the run_tests.py script needs to have the --exit_code
+        argument passed in order to return non-zero codes, which we need for the
+        build master to distinguish failures from successful runs.
+
+        Secondly, it modifies the layout test runner to briefly wait (through
+        the wait-for-device command) after requesting a device to switch to root
+        mode. Without this waiting period, commands might get lost and thereby
+        unexpectedly fail.
+
+        * Scripts/run-api-tests:
+        * Scripts/run-chromium-webkit-unit-tests:
+        * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+        (ChromiumAndroidDriver._setup_test):
+        (ChromiumAndroidDriver._restart_adb_as_root):
+
 2012-11-22  Simon Hausmann  <[email protected]>, Pierre Rossi <[email protected]>
 
         [Qt] Separate QWidget dependant code into separate WebKitWidgets static library

Modified: trunk/Tools/Scripts/run-api-tests (135551 => 135552)


--- trunk/Tools/Scripts/run-api-tests	2012-11-23 01:53:02 UTC (rev 135551)
+++ trunk/Tools/Scripts/run-api-tests	2012-11-23 02:38:54 UTC (rev 135552)
@@ -83,7 +83,7 @@
 # When running TestWebKitAPI for Chromium on Android, defer to the test runner in
 # Chromium as we can't execute the binary locally.
 if (isChromiumAndroid()) {
-    my @runTestCommand = ('build/android/run_tests.py', '--verbose', '--webkit', '--out-directory', sourceDir() . '/out', '-s', 'TestWebKitAPI');
+    my @runTestCommand = ('build/android/run_tests.py', '--verbose', '--webkit', '--exit_code', '--out-directory', sourceDir() . '/out', '-s', 'TestWebKitAPI');
     if (configuration() eq "Release") {
         push @runTestCommand, '--release';
     }

Modified: trunk/Tools/Scripts/run-chromium-webkit-unit-tests (135551 => 135552)


--- trunk/Tools/Scripts/run-chromium-webkit-unit-tests	2012-11-23 01:53:02 UTC (rev 135551)
+++ trunk/Tools/Scripts/run-chromium-webkit-unit-tests	2012-11-23 02:38:54 UTC (rev 135552)
@@ -38,7 +38,7 @@
 
 # Defer to Android's test runners for running webkit_unit_tests on a device.
 if (checkForArgumentAndRemoveFromARGV('--platform=chromium-android')) {
-    my @runTestCommand = ('build/android/run_tests.py', '--verbose', '--webkit', '--out-directory', sourceDir() . '/out', '-s', 'webkit_unit_tests');
+    my @runTestCommand = ('build/android/run_tests.py', '--verbose', '--webkit', '--exit_code', '--out-directory', sourceDir() . '/out', '-s', 'webkit_unit_tests');
     if (configuration() eq "Release") {
         push @runTestCommand, '--release';
     }

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py (135551 => 135552)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py	2012-11-23 01:53:02 UTC (rev 135551)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py	2012-11-23 02:38:54 UTC (rev 135552)
@@ -354,7 +354,7 @@
         if self._has_setup:
             return
 
-        self._run_adb_command(['root'])
+        self._restart_adb_as_root()
         self._setup_md5sum_and_push_data_if_needed()
         self._has_setup = True
         self._setup_performance()
@@ -425,6 +425,15 @@
         for resource in TEST_RESOURCES_TO_PUSH:
             self._push_file_if_needed(self._port.layout_tests_dir() + '/' + resource, DEVICE_LAYOUT_TESTS_DIR + resource)
 
+    def _restart_adb_as_root(self):
+        output = self._run_adb_command(['root'])
+        if 'adbd is already running as root' in output:
+            return
+        elif 'restarting adbd as root' in output:
+            self._run_adb_command(['wait-for-device'])
+        else:
+            self._log_error('Unrecognized output from adb root: %s' % output)
+
     def _run_adb_command(self, cmd, ignore_error=False):
         self._log_debug('Run adb command: ' + str(cmd))
         if ignore_error:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to