Unreviewed, rolling out r209136.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2016 22:15:10 +0000 (22:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2016 22:15:10 +0000 (22:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=165337

broke 36 webkitpy tests (Requested by mcatanzaro on #webkit).

Reverted changeset:

"Make it possible to use an existing simulator instance for
one-off testing"
https://bugs.webkit.org/show_bug.cgi?id=164568
http://trac.webkit.org/changeset/209136

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209266 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
Tools/Scripts/webkitpy/port/ios.py
Tools/Scripts/webkitpy/xcode/simulator.py

index 02a24ea..be84585 100644 (file)
@@ -1,3 +1,17 @@
+2016-12-02  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r209136.
+        https://bugs.webkit.org/show_bug.cgi?id=165337
+
+        broke 36 webkitpy tests (Requested by mcatanzaro on #webkit).
+
+        Reverted changeset:
+
+        "Make it possible to use an existing simulator instance for
+        one-off testing"
+        https://bugs.webkit.org/show_bug.cgi?id=164568
+        http://trac.webkit.org/changeset/209136
+
 2016-12-02  Chris Dumez  <cdumez@apple.com>
 
         [Mac][WK1] Implement new HTML interactive form validation user interface
index 7173809..8254333 100755 (executable)
@@ -296,8 +296,6 @@ def parse_args(args):
     option_group_definitions.append(("iOS Simulator Options", [
         optparse.make_option('--runtime', help='iOS Simulator runtime identifier (default: latest runtime)'),
         optparse.make_option('--device-type', help='iOS Simulator device type identifier (default: i386 -> iPhone 5, x86_64 -> iPhone 5s)'),
-        optparse.make_option('--dedicated-simulators', action="store_true", default=False,
-            help="If set, dedicated iOS simulators will always be created.  If not set, the script will attempt to use any currently running simulator."),
     ]))
 
     option_group_definitions.append(("Miscellaneous Options", [
index 6812f59..04d2d4b 100644 (file)
@@ -103,14 +103,6 @@ class IOSSimulatorPort(DarwinPort):
         self._device_class = optional_device_class if optional_device_class else self.DEFAULT_DEVICE_CLASS
         _log.debug('IOSSimulatorPort _device_class is %s', self._device_class)
 
-        self._current_device = Simulator().current_device()
-        if not self._current_device:
-            self.set_option('dedicated_simulators', True)
-        if not self.get_option('dedicated_simulators'):
-            if self.get_option('child_processes') > 1:
-                _log.warn('Cannot have more than one child process when using a running simulator.  Setting child_processes to 1.')
-            self.set_option('child_processes', 1)
-
     def driver_name(self):
         if self.get_option('driver_name'):
             return self.get_option('driver_name')
@@ -284,21 +276,15 @@ class IOSSimulatorPort(DarwinPort):
                 _log.warn("maximum child-processes which can be supported on this system are: {0}".format(self.default_child_processes()))
                 _log.warn("This is very likely to fail.")
 
-        if self._using_dedicated_simulators():
-            self._createSimulatorApps()
+        self._createSimulatorApps()
 
-            for i in xrange(self.child_processes()):
-                self._create_device(i)
+        for i in xrange(self.child_processes()):
+            self._create_device(i)
 
-            for i in xrange(self.child_processes()):
-                device_udid = self._testing_device(i).udid
-                Simulator.wait_until_device_is_in_state(device_udid, Simulator.DeviceState.SHUTDOWN)
-                Simulator.reset_device(device_udid)
-        else:
-            assert(self._current_device)
-            if self._current_device.name != self.simulator_device_type().name:
-                _log.warn("Expected simulator of type '" + self.simulator_device_type().name + "' but found simulator of type '" + self._current_device.name + "'")
-                _log.warn('The next block of tests may fail due to device mis-match')
+        for i in xrange(self.child_processes()):
+            device_udid = self._testing_device(i).udid
+            Simulator.wait_until_device_is_in_state(device_udid, Simulator.DeviceState.SHUTDOWN)
+            Simulator.reset_device(device_udid)
 
     def setup_test_run(self, device_class=None):
         mac_os_version = self.host.platform.os_version
@@ -310,9 +296,6 @@ class IOSSimulatorPort(DarwinPort):
 
         self._create_simulators()
 
-        if not self._using_dedicated_simulators():
-            return
-
         for i in xrange(self.child_processes()):
             device_udid = self._testing_device(i).udid
             _log.debug('testing device %s has udid %s', i, device_udid)
@@ -330,8 +313,6 @@ class IOSSimulatorPort(DarwinPort):
             Simulator.wait_until_device_is_booted(self._testing_device(i).udid)
 
     def _quit_ios_simulator(self):
-        if not self._using_dedicated_simulators():
-            return
         _log.debug("_quit_ios_simulator killing all Simulator processes")
         # FIXME: We should kill only the Simulators we started.
         subprocess.call(["killall", "-9", "-m", "Simulator"])
@@ -348,9 +329,6 @@ class IOSSimulatorPort(DarwinPort):
                 _log.warning('Unable to remove ' + fifo)
                 pass
 
-        if not self._using_dedicated_simulators():
-            return
-
         for i in xrange(self.child_processes()):
             simulator_path = self.get_simulator_path(i)
             device_udid = self._testing_device(i).udid
@@ -401,9 +379,6 @@ class IOSSimulatorPort(DarwinPort):
 
     SUBPROCESS_CRASH_REGEX = re.compile('#CRASHED - (?P<subprocess_name>\S+) \(pid (?P<subprocess_pid>\d+)\)')
 
-    def _using_dedicated_simulators(self):
-        return self.get_option('dedicated_simulators')
-
     def _create_device(self, number):
         return Simulator.create_device(number, self.simulator_device_type(), self.simulator_runtime)
 
@@ -417,9 +392,7 @@ class IOSSimulatorPort(DarwinPort):
     def device_id_for_worker_number(self, number):
         if self._printing_cmd_line:
             return '<dummy id>'
-        if self._using_dedicated_simulators():
-            return self._testing_device(number).udid
-        return self._current_device.udid
+        return self._testing_device(number).udid
 
     def get_simulator_path(self, suffix=""):
         return os.path.join(self.SIMULATOR_DIRECTORY, "Simulator" + str(suffix) + ".app")
index 27967e3..b6aa3da 100644 (file)
@@ -529,14 +529,6 @@ class Simulator(object):
                 return device
         return None
 
-    def current_device(self):
-        # FIXME: Find the simulator device that was booted by Simulator.app. For now, pick some booted simulator device, which
-        # may have been booted using the simctl command line tool.
-        for device in self.devices:
-            if device.state == Simulator.DeviceState.BOOTED:
-                return device
-        return None
-
     # FIXME: We should find an existing device with respect to its name, device type and runtime.
     def device(self, name=None, runtime=None, should_ignore_unavailable_devices=False):
         """