run-webkit-tests: Cap the number of automatically booted simulators at 12
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Aug 2019 17:21:28 +0000 (17:21 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Aug 2019 17:21:28 +0000 (17:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201139

Reviewed by Aakash Jain.

To make local development with simulators more pleasant, machines should
never automatically boot more than 12 simulators.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.max_supported_simulators):

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

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

index 1a8c765..8487d10 100644 (file)
@@ -1,3 +1,16 @@
+2019-08-26  Jonathan Bedard  <jbedard@apple.com>
+
+        run-webkit-tests: Cap the number of automatically booted simulators at 12
+        https://bugs.webkit.org/show_bug.cgi?id=201139
+
+        Reviewed by Aakash Jain.
+
+        To make local development with simulators more pleasant, machines should
+        never automatically boot more than 12 simulators.
+
+        * Scripts/webkitpy/xcode/simulated_device.py:
+        (SimulatedDeviceManager.max_supported_simulators):
+
 2019-08-26  Aakash Jain  <aakash_jain@apple.com>
 
         [ews] Add EWS queue for applying watchlist
index fb1a52d..1847c75 100644 (file)
@@ -67,6 +67,10 @@ class SimulatedDeviceManager(object):
     MEMORY_ESTIMATE_PER_SIMULATOR_INSTANCE = 6 * (1024 ** 3)  # 6GB a simulator.
     PROCESS_COUNT_ESTIMATE_PER_SIMULATOR_INSTANCE = 125
 
+    # Testing on iMac Pros has indicated that more than 12 simulators, even if we seem to have enough resources for them,
+    # results in diminishing returns.
+    MAX_NUMBER_OF_SIMULATORS = 12
+
     xcrun = '/usr/bin/xcrun'
     simulator_device_path = '~/Library/Developer/CoreSimulator/Devices'
     simulator_bundle_id = 'com.apple.iphonesimulator'
@@ -417,7 +421,11 @@ class SimulatedDeviceManager(object):
         except (ValueError, ScriptError):
             return 0
 
-        max_supported_simulators_for_hardware = min(host.executive.cpu_count() / 2, host.platform.total_bytes_memory() // SimulatedDeviceManager.MEMORY_ESTIMATE_PER_SIMULATOR_INSTANCE)
+        max_supported_simulators_for_hardware = min(
+            host.executive.cpu_count() // 2,
+            host.platform.total_bytes_memory() // SimulatedDeviceManager.MEMORY_ESTIMATE_PER_SIMULATOR_INSTANCE,
+            SimulatedDeviceManager.MAX_NUMBER_OF_SIMULATORS,
+        )
         max_supported_simulators_locally = (system_process_count_limit - current_process_count) // SimulatedDeviceManager.PROCESS_COUNT_ESTIMATE_PER_SIMULATOR_INSTANCE
 
         if (max_supported_simulators_locally < max_supported_simulators_for_hardware):