Modified: trunk/Tools/ChangeLog (194225 => 194226)
--- trunk/Tools/ChangeLog 2015-12-17 20:21:19 UTC (rev 194225)
+++ trunk/Tools/ChangeLog 2015-12-17 20:28:50 UTC (rev 194226)
@@ -1,3 +1,17 @@
+2015-12-17 Aakash Jain <[email protected]>
+
+ run-webkit-tests shouldn't start multiple iOS simulators while only running one test
+ https://bugs.webkit.org/show_bug.cgi?id=152157
+ <rdar://problem/23851817>
+
+ Reviewed by Alexey Proskuryakov.
+
+ * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
+ (LayoutTestRunner.get_worker_count): Calculate required number of workers.
+ * Scripts/webkitpy/layout_tests/controllers/manager.py:
+ (Manager._get_test_inputs): Common method to calculate test_inputs.
+ (Manager._update_worker_count): Calculate and update required number of workers.
+
2015-12-16 Aakash Jain <[email protected]>
run-webkit-tests fails to delete Simulator device during cleanup
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py (194225 => 194226)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py 2015-12-17 20:21:19 UTC (rev 194225)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py 2015-12-17 20:28:50 UTC (rev 194226)
@@ -78,6 +78,10 @@
self._retrying = False
self._current_run_results = None
+ def get_worker_count(self, test_inputs, child_process_count):
+ all_shards = self._sharder.shard_tests(test_inputs, child_process_count, self._options.fully_parallel)
+ return min(child_process_count, len(all_shards))
+
def run_tests(self, expectations, test_inputs, tests_to_skip, num_workers, needs_http, needs_websockets, needs_web_platform_test_server, retrying):
self._expectations = expectations
self._test_inputs = test_inputs
@@ -106,7 +110,6 @@
if (self._needs_http and self._options.http) or self._needs_web_platform_test_server:
self.start_servers()
- num_workers = min(num_workers, len(all_shards))
self._printer.print_workers_and_shards(num_workers, len(all_shards))
if self._options.dry_run:
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (194225 => 194226)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2015-12-17 20:21:19 UTC (rev 194225)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2015-12-17 20:28:50 UTC (rev 194226)
@@ -135,6 +135,19 @@
def needs_servers(self, test_names):
return any(self._is_http_test(test_name) for test_name in test_names) and self._options.http
+ def _get_test_inputs(self, tests_to_run, repeat_each, iterations):
+ test_inputs = []
+ for _ in xrange(iterations):
+ for test in tests_to_run:
+ for _ in xrange(repeat_each):
+ test_inputs.append(self._test_input_for_file(test))
+ return test_inputs
+
+ def _update_worker_count(self, test_names):
+ test_inputs = self._get_test_inputs(test_names, self._options.repeat_each, self._options.iterations)
+ worker_count = self._runner.get_worker_count(test_inputs, int(self._options.child_processes))
+ self._options.child_processes = worker_count
+
def _set_up_run(self, test_names):
self._printer.write_update("Checking build ...")
if not self._port.check_build(self.needs_servers(test_names)):
@@ -147,6 +160,7 @@
if not self._port.start_helper(self._options.pixel_tests):
return False
+ self._update_worker_count(test_names)
self._port.reset_preferences()
# Check that the system dependencies (themes, fonts, ...) are correct.
@@ -251,11 +265,7 @@
needs_web_platform_test_server = any(self._is_web_platform_test(test) for test in tests_to_run)
needs_websockets = any(self._is_websocket_test(test) for test in tests_to_run)
- test_inputs = []
- for _ in xrange(iterations):
- for test in tests_to_run:
- for _ in xrange(repeat_each):
- test_inputs.append(self._test_input_for_file(test))
+ test_inputs = self._get_test_inputs(tests_to_run, repeat_each, iterations)
return self._runner.run_tests(self._expectations, test_inputs, tests_to_skip, num_workers, needs_http, needs_websockets, needs_web_platform_test_server, retrying)
def _clean_up_run(self):