webkitpy: Ignore errors when shutting down an already shutdown simulator
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2019 17:01:35 +0000 (17:01 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2019 17:01:35 +0000 (17:01 +0000)
<https://bugs.webkit.org/show_bug.cgi?id=197514>
<rdar://problem/50390247>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice._shut_down):

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

Tools/ChangeLog
Tools/Scripts/webkitpy/xcode/simulated_device.py

index 5022fc6..e5b4c00 100644 (file)
@@ -1,3 +1,14 @@
+2019-05-02  Jonathan Bedard  <jbedard@apple.com>
+
+        webkitpy: Ignore errors when shutting down an already shutdown simulator
+        <https://bugs.webkit.org/show_bug.cgi?id=197514>
+        <rdar://problem/50390247>
+
+        Reviewed by Lucas Forschler.
+
+        * Scripts/webkitpy/xcode/simulated_device.py:
+        (SimulatedDevice._shut_down):
+
 2019-05-02  Frederic Wang  <fwang@igalia.com>
 
         [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime
index 16b0233..5d4bab3 100644 (file)
@@ -544,7 +544,7 @@ class SimulatedDevice(object):
 
         # Either shutdown is successful, or the device was already shutdown when we attempted to shut it down.
         exit_code = self.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'shutdown', self.udid], return_exit_code=True)
-        if exit_code != 0 and exit_code != 164:
+        if exit_code != 0 and self.state() != SimulatedDevice.DeviceState.SHUT_DOWN:
             raise RuntimeError('Failed to shutdown {} with exit code {}'.format(self.udid, exit_code))
 
         while self.state(force_update=True) != SimulatedDevice.DeviceState.SHUT_DOWN: