Bug 152157 - run-webkit-tests shouldn't start multiple iOS simulators while only running one test
Summary: run-webkit-tests shouldn't start multiple iOS simulators while only running o...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-12-10 17:26 PST by Jiewen Tan
Modified: 2015-12-17 12:29 PST (History)
8 users (show)

See Also:


Attachments
Proposed patch (4.57 KB, patch)
2015-12-16 16:41 PST, Aakash Jain
no flags Details | Formatted Diff | Diff
Minor improvement in Manager::_update_num_workers() (4.56 KB, patch)
2015-12-16 16:58 PST, Aakash Jain
no flags Details | Formatted Diff | Diff
Proposed patch (4.51 KB, patch)
2015-12-17 10:48 PST, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiewen Tan 2015-12-10 17:26:30 PST
Currently, if I specify commands like this: run-webkit-tests --ios-simulator ./fast/images/image-load-event-crash.html.
The script will start multiple iOS simulators. In my case, there are three. However, only one simulator will run the test while others are just idle.

Here is a log:
Jiewens-Mac-Pro:LayoutTests jwtan$ run-webkit-tests --ios-simulator ./fast/images/image-load-event-crash.html 
Process limit: 709, current #processes: 333
This machine could support 4 child processes, but only has enough process limit for 3.
Run "launchctl limit" to check these limits
Using port 'ios-simulator-wk2'
Test configuration: <, x86_64, debug>
Placing test results in /Users/jwtan/Documents/Build/Products/Debug-iphonesimulator/layout-test-results
Baseline search path: ios-simulator-wk2 -> ios-simulator -> wk2 -> generic
Using Debug build
Pixel tests disabled
Regular timeout: 30000, slow test timeout: 150000
Command line: /Users/jwtan/Documents/Build/Products/Debug/LayoutTestRelay -runtime com.apple.CoreSimulator.SimRuntime.iOS-10-0 -deviceType com.apple.CoreSimulator.SimDeviceType.iPhone-5s -suffix 0 -productDir /Users/jwtan/Documents/Build/Products/Debug-iphonesimulator -app /Users/jwtan/Documents/Build/Products/Debug-iphonesimulator/WebKitTestRunnerApp.app -- -

--lint-test-files warnings:
LayoutTests/platform/ios-simulator-wk2/TestExpectations:497 Path does not exist. http/tests/inspector/console/access-inspected-object.html

Found 1 test; running 1, skipping 0.
Starting helper ...kill -KILL 72979
Creating app:/tmp/WebKitTestingSimulators/Simulator0.app
/tmp/WebKitTestingSimulators/Simulator0.app: replacing existing signature
lsregister: processing /tmp/WebKitTestingSimulators/Simulator0.app
lsregister: registered /tmp/WebKitTestingSimulators/Simulator0.app
Creating app:/tmp/WebKitTestingSimulators/Simulator1.app
/tmp/WebKitTestingSimulators/Simulator1.app: replacing existing signature
lsregister: processing /tmp/WebKitTestingSimulators/Simulator1.app
lsregister: registered /tmp/WebKitTestingSimulators/Simulator1.app
Creating app:/tmp/WebKitTestingSimulators/Simulator2.app
/tmp/WebKitTestingSimulators/Simulator2.app: replacing existing signature
lsregister: processing /tmp/WebKitTestingSimulators/Simulator2.app
lsregister: registered /tmp/WebKitTestingSimulators/Simulator2.app
Waiting for all iOS Simulators to finish booting.
Running 1 WebKitTestRunnerApp.app.

kill -KILL 74070                             
kill -KILL 74067
kill -KILL 74040
kill -KILL 74019
kill -KILL 74016
kill -KILL 73987
kill -KILL 73968
kill -KILL 73965
kill -KILL 73937
kill -KILL 73786
lsregister: processing /tmp/WebKitTestingSimulators/Simulator0.app
lsregister: unregistered /tmp/WebKitTestingSimulators/Simulator0.app
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Unable to delete device in current state: Booted
lsregister: processing /tmp/WebKitTestingSimulators/Simulator1.app
lsregister: unregistered /tmp/WebKitTestingSimulators/Simulator1.app
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Unable to delete device in current state: Booted
lsregister: processing /tmp/WebKitTestingSimulators/Simulator2.app
lsregister: unregistered /tmp/WebKitTestingSimulators/Simulator2.app
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Unable to delete device in current state: Booted
The test ran as expected.
Comment 1 Radar WebKit Bug Importer 2015-12-10 17:27:38 PST
<rdar://problem/23851817>
Comment 2 Aakash Jain 2015-12-16 16:41:44 PST
Created attachment 267509 [details]
Proposed patch
Comment 3 Aakash Jain 2015-12-16 16:58:09 PST
Created attachment 267511 [details]
Minor improvement in Manager::_update_num_workers()
Comment 4 Alexey Proskuryakov 2015-12-17 09:40:15 PST
Comment on attachment 267511 [details]
Minor improvement in Manager::_update_num_workers()

View in context: https://bugs.webkit.org/attachment.cgi?id=267511&action=review

> Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:81
> +    def get_num_workers(self, test_inputs, num_child_processes):

It still irks me to see "num" in code, WebKit coding style calls for no abbreviations. Could you please update variable and function names to avoid using "num"?

> Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:84
> +        self._printer.write_update('Number of workers: %d' % num_workers)

This is new logging, but I remember that we already print out the number of workers. Is it useful to have more? How does it the end result look?
Comment 5 Aakash Jain 2015-12-17 10:48:57 PST
Created attachment 267570 [details]
Proposed patch

Changed num to count. Removed the extra logging.
Comment 6 WebKit Commit Bot 2015-12-17 12:29:17 PST
Comment on attachment 267570 [details]
Proposed patch

Clearing flags on attachment: 267570

Committed r194226: <http://trac.webkit.org/changeset/194226>
Comment 7 WebKit Commit Bot 2015-12-17 12:29:23 PST
All reviewed patches have been landed.  Closing bug.