Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulator freezes when running detox tests #1526

Closed
llostris opened this issue Jul 11, 2019 · 3 comments
Closed

Simulator freezes when running detox tests #1526

llostris opened this issue Jul 11, 2019 · 3 comments

Comments

@llostris
Copy link

We're having an issue when running our e2e test suite, particularly when running on CI (Bitrise).
During the test suite, a few tests (different on each run) will error out with:

  ● Test suite failed to run

    Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.

      at mapper (node_modules/jest-jasmine2/build/queueRunner.js:25:45)

What actually happens is the simulator freezes and becomes unresponsive (it's impossible to click on anything, use the keyboard, turn it off using the rendered power button; you need to kill it using Cmd+W, or restart using Hardware menu). When it happens, all following tests in the given file fail with a Timeout error.
Then, when we're starting a new test suite (new spec file), a new simulator is opened by Detox and the tests carry on... until this happens again.
I've seen it happens 2 times in the test suite, resulting in 3 simulators being open (2 of them frozen).

Error log for the test suite in which this happens:

I.e. logs for frozen tests testing deep links (using either device.opernURL() or device.launchApp()):


DeepLinking when launching app from the deep link: should go to My Orders page [OK]
DeepLinking when launching app from the deep link: should go to My Account page
detox[76523] TRACE: [Detox.js/DETOX_AFTER_EACH] �[90mpassed test: "DeepLinking when launching app from the deep link should go to My Orders page"�[39m
detox[76523] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onAfterEach({ title: 'should go to My Orders page',�[39m
�[90m  fullName:�[39m
�[90m   'DeepLinking when launching app from the deep link should go to My Orders page',�[39m
�[90m  status: 'passed' })�[39m
detox[76523] TRACE: [Artifact.js/STOP] �[90mstopping SimulatorVideoRecording�[39m
detox[76523] DEBUG: [exec.js/KILL] �[36msending SIGINT to [pid = 91237]: /usr/bin/xcrun simctl io 2CF919FD-473E-4386-9EE0-57A0DD2009E1 recordVideo /private/var/folders/qk/07x9s51136jdkzv7t2_q2n5h0000gp/T/b97eefb5-97aa-489b-b735-170d17c94599.mp4�[39m
detox[76523] TRACE: [exec.js/SPAWN_END, #15] �[90m/usr/bin/xcrun simctl io 2CF919FD-473E-4386-9EE0-57A0DD2009E1 recordVideo /private/var/folders/qk/07x9s51136jdkzv7t2_q2n5h0000gp/T/b97eefb5-97aa-489b-b735-170d17c94599.mp4 finished with code = 0�[39m
detox[76523] TRACE: [Artifact.js/DISCARD] �[90mdiscarding SimulatorVideoRecording�[39m
detox[76523] TRACE: [Artifact.js/STOP] �[90mstopping SimulatorLogRecording�[39m
detox[76523] DEBUG: [exec.js/KILL] �[36msending SIGINT to [pid = 91443]: /usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate processImagePath beginsWith "/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app"�[39m
detox[76523] TRACE: [exec.js/SPAWN_END, #18] �[90m/usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app\"" finished with code = 130�[39m
detox[76523] TRACE: [Artifact.js/DISCARD] �[90mdiscarding SimulatorLogRecording�[39m
detox[76523] TRACE: [Detox.js/DETOX_BEFORE_EACH] �[90mrunning test: "DeepLinking when launching app from the deep link should go to My Account page"�[39m
detox[76523] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onBeforeEach({ title: 'should go to My Account page',�[39m
�[90m  fullName:�[39m
�[90m   'DeepLinking when launching app from the deep link should go to My Account page',�[39m
�[90m  status: 'running' })�[39m
detox[76523] TRACE: [Artifact.js/START] �[90mstarting SimulatorLogRecording�[39m
detox[76523] DEBUG: [exec.js/EXEC_CMD, #21] �[36m/usr/bin/xcrun simctl get_app_container 2CF919FD-473E-4386-9EE0-57A0DD2009E1 com.myapp.MyApp�[39m
detox[76523] TRACE: [exec.js/EXEC_SUCCESS, #21] �[90m/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app�[39m
�[90m�[39m
detox[76523] DEBUG: [exec.js/SPAWN_CMD, #22] �[36m[pid=91866] /usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app\""�[39m
detox[76523] TRACE: [Artifact.js/START] �[90mstarting SimulatorVideoRecording�[39m
detox[76523] DEBUG: [exec.js/SPAWN_CMD, #23] �[36m[pid=91868] /usr/bin/xcrun simctl io 2CF919FD-473E-4386-9EE0-57A0DD2009E1 recordVideo /private/var/folders/qk/07x9s51136jdkzv7t2_q2n5h0000gp/T/c42a7ded-1c45-41f5-b71f-4f2111b3bf4c.mp4�[39m
detox[76523] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onBeforeTerminateApp({ deviceId: '2CF919FD-473E-4386-9EE0-57A0DD2009E1',�[39m
�[90m  bundleId: 'com.myapp.MyApp' })�[39m
detox[76523] DEBUG: [exec.js/EXEC_CMD, #24] �[36m/usr/bin/xcrun simctl terminate 2CF919FD-473E-4386-9EE0-57A0DD2009E1 com.myapp.MyApp�[39m
detox[76523] DEBUG: [exec.js/EXEC_TRY, #24] �[36mTerminating com.myapp.MyApp...�[39m
detox[76523] TRACE: [exec.js/EXEC_SUCCESS, #24] 
detox[76523] DEBUG: [exec.js/EXEC_SUCCESS, #24] �[36mcom.myapp.MyApp terminated�[39m
detox[76523] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onBeforeLaunchApp({ bundleId: 'com.myapp.MyApp',�[39m
�[90m  deviceId: '2CF919FD-473E-4386-9EE0-57A0DD2009E1',�[39m
�[90m  launchArgs:�[39m
�[90m   { detoxServer: 'ws://localhost:65497',�[39m
�[90m     detoxSessionId: 'e607eb46-4c71-ee99-c78a-de99f4d0e423',�[39m
�[90m     detoxURLOverride: 'https://www.myapp.com/my-account/' } })�[39m
detox[76523] TRACE: [Artifact.js/START] �[90mstarting SimulatorLogRecording { udid: '2CF919FD-473E-4386-9EE0-57A0DD2009E1',�[39m
�[90m  bundleId: 'com.myapp.MyApp' }�[39m
detox[76523] TRACE: [Artifact.js/STOP] �[90mstopping SimulatorLogRecording�[39m
detox[76523] DEBUG: [DetoxServer.js/DISCONNECT] �[36mrole=testee, sessionId=e607eb46-4c71-ee99-c78a-de99f4d0e423�[39m
detox[76523] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] �[90m{"type":"testeeDisconnected","messageId":-49642}�[39m
�[90m �[39m
detox[76523] DEBUG: [exec.js/KILL] �[36msending SIGINT to [pid = 91866]: /usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate processImagePath beginsWith "/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app"�[39m
detox[76523] TRACE: [exec.js/SPAWN_END, #22] �[90m/usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app\"" finished with code = 130�[39m
detox[76523] DEBUG: [exec.js/EXEC_CMD, #25] �[36m/usr/bin/xcrun simctl get_app_container 2CF919FD-473E-4386-9EE0-57A0DD2009E1 com.myapp.MyApp�[39m
detox[76523] TRACE: [exec.js/EXEC_SUCCESS, #25] �[90m/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app�[39m
�[90m�[39m
detox[76523] DEBUG: [exec.js/SPAWN_CMD, #26] �[36m[pid=91876] /usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app\""�[39m
detox[76523] DEBUG: [exec.js/EXEC_CMD, #27] �[36mSIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/llostris/Library/Detox/ios/badb476fed8cb993d3a9472b0ab39d2774d7d56c/Detox.framework/Detox" /usr/bin/xcrun simctl launch 2CF919FD-473E-4386-9EE0-57A0DD2009E1 com.myapp.MyApp --args -detoxServer "ws://localhost:65497" -detoxSessionId "e607eb46-4c71-ee99-c78a-de99f4d0e423" -detoxURLOverride "https://www.myapp.com/my-account/"�[39m
detox[76523] DEBUG: [exec.js/EXEC_TRY, #27] �[36mLaunching com.myapp.MyApp...�[39m
detox[76523] TRACE: [exec.js/EXEC_SUCCESS, #27] �[90mcom.myapp.MyApp: 91886�[39m
�[90m�[39m
detox[76523] DEBUG: [exec.js/EXEC_CMD, #28] �[36m/usr/bin/xcrun simctl get_app_container 2CF919FD-473E-4386-9EE0-57A0DD2009E1 com.myapp.MyApp�[39m
detox[76523] TRACE: [exec.js/EXEC_SUCCESS, #28] �[90m/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app�[39m
�[90m�[39m
detox[76523] INFO:  [AppleSimUtils.js] �[32mcom.myapp.MyApp launched. To watch simulator logs, run:�[39m
�[32m        /usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate 'processImagePath beginsWith "/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app"'�[39m
detox[91886] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onLaunchApp({ bundleId: 'com.myapp.MyApp',�[39m
�[90m  deviceId: '2CF919FD-473E-4386-9EE0-57A0DD2009E1',�[39m
�[90m  launchArgs:�[39m
�[90m   { detoxServer: 'ws://localhost:65497',�[39m
�[90m     detoxSessionId: 'e607eb46-4c71-ee99-c78a-de99f4d0e423',�[39m
�[90m     detoxURLOverride: 'https://www.myapp.com/my-account/' },�[39m
�[90m  pid: 91886 })�[39m
detox[76523] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] �[90m{"type":"isReady","params":{},"messageId":-1000}�[39m
detox[76523] TRACE: [DetoxServer.js/MESSAGE] �[90mrole=tester action=isReady (sessionId=e607eb46-4c71-ee99-c78a-de99f4d0e423)�[39m
detox[76523] DEBUG: [DetoxServer.js/CANNOT_FORWARD] �[36mrole=testee not connected, cannot fw action (sessionId=e607eb46-4c71-ee99-c78a-de99f4d0e423)�[39m
detox[76523] DEBUG: [DetoxServer.js/LOGIN] �[36mrole=testee, sessionId=e607eb46-4c71-ee99-c78a-de99f4d0e423�[39m
detox[76523] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] �[36mrole=testee, sessionId=e607eb46-4c71-ee99-c78a-de99f4d0e423�[39m
DeepLinking when launching app from the deep link: should go to My Account page [FAIL]
DeepLinking when launching app from the deep link: should go to a specific menu day
detox[76523] TRACE: [Detox.js/DETOX_AFTER_EACH] �[90mfailed test: "DeepLinking when launching app from the deep link should go to My Account page"�[39m
detox[76523] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onAfterEach({ title: 'should go to My Account page',�[39m
�[90m  fullName:�[39m
�[90m   'DeepLinking when launching app from the deep link should go to My Account page',�[39m
�[90m  status: 'failed' })�[39m
detox[76523] TRACE: [Artifact.js/STOP] �[90mstopping SimulatorVideoRecording�[39m
detox[76523] DEBUG: [exec.js/KILL] �[36msending SIGINT to [pid = 91868]: /usr/bin/xcrun simctl io 2CF919FD-473E-4386-9EE0-57A0DD2009E1 recordVideo /private/var/folders/qk/07x9s51136jdkzv7t2_q2n5h0000gp/T/c42a7ded-1c45-41f5-b71f-4f2111b3bf4c.mp4�[39m
detox[76523] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onBeforeTerminateApp({ deviceId: '2CF919FD-473E-4386-9EE0-57A0DD2009E1',�[39m
�[90m  bundleId: 'com.myapp.MyApp' })�[39m
detox[76523] DEBUG: [exec.js/EXEC_CMD, #29] �[36m/usr/bin/xcrun simctl terminate 2CF919FD-473E-4386-9EE0-57A0DD2009E1 com.myapp.MyApp�[39m
detox[76523] DEBUG: [exec.js/EXEC_TRY, #29] �[36mTerminating com.myapp.MyApp...�[39m
detox[76523] TRACE: [exec.js/EXEC_SUCCESS, #29] 
detox[76523] DEBUG: [exec.js/EXEC_SUCCESS, #29] �[36mcom.myapp.MyApp terminated�[39m
detox[76523] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onBeforeLaunchApp({ bundleId: 'com.myapp.MyApp',�[39m
�[90m  deviceId: '2CF919FD-473E-4386-9EE0-57A0DD2009E1',�[39m
�[90m  launchArgs:�[39m
�[90m   { detoxServer: 'ws://localhost:65497',�[39m
�[90m     detoxSessionId: 'e607eb46-4c71-ee99-c78a-de99f4d0e423',�[39m
�[90m     detoxURLOverride: 'https://www.myapp.com/menu/1/' } })�[39m
detox[76523] TRACE: [Artifact.js/START] �[90mstarting SimulatorLogRecording { udid: '2CF919FD-473E-4386-9EE0-57A0DD2009E1',�[39m
�[90m  bundleId: 'com.myapp.MyApp' }�[39m
detox[76523] TRACE: [Artifact.js/STOP] �[90mstopping SimulatorLogRecording�[39m
detox[76523] DEBUG: [exec.js/KILL] �[36msending SIGINT to [pid = 91876]: /usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate processImagePath beginsWith "/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app"�[39m
detox[76523] TRACE: [exec.js/SPAWN_END, #26] �[90m/usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app\"" finished with code = 130�[39m
detox[76523] DEBUG: [exec.js/EXEC_CMD, #30] �[36m/usr/bin/xcrun simctl get_app_container 2CF919FD-473E-4386-9EE0-57A0DD2009E1 com.myapp.MyApp�[39m
detox[76523] TRACE: [exec.js/EXEC_SUCCESS, #30] �[90m/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app�[39m
�[90m�[39m
detox[76523] DEBUG: [exec.js/SPAWN_CMD, #31] �[36m[pid=98264] /usr/bin/xcrun simctl spawn 2CF919FD-473E-4386-9EE0-57A0DD2009E1 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/llostris/Library/Developer/CoreSimulator/Devices/2CF919FD-473E-4386-9EE0-57A0DD2009E1/data/Containers/Bundle/Application/4E62F998-F640-483A-8330-7B05B4F13557/MyMobileApp.app\""�[39m
detox[76523] DEBUG: [exec.js/EXEC_CMD, #32] �[36mSIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/llostris/Library/Detox/ios/badb476fed8cb993d3a9472b0ab39d2774d7d56c/Detox.framework/Detox" /usr/bin/xcrun simctl launch 2CF919FD-473E-4386-9EE0-57A0DD2009E1 com.myapp.MyApp --args -detoxServer "ws://localhost:65497" -detoxSessionId "e607eb46-4c71-ee99-c78a-de99f4d0e423" -detoxURLOverride "https://www.myapp.com/menu/1/"�[39m
detox[76523] DEBUG: [exec.js/EXEC_TRY, #32] �[36mLaunching com.myapp.MyApp...�[39m
DeepLinking when launching app from the deep link: should go to a specific menu day [FAIL]
DeepLinking when launching app from the deep link: should go to a specific menu date
detox[76523] TRACE: [Detox.js/DETOX_AFTER_EACH] �[90mfailed test: "DeepLinking when launching app from the deep link should go to a specific menu day"�[39m
detox[76523] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onAfterEach({ title: 'should go to a specific menu day',�[39m
�[90m  fullName:�[39m
�[90m   'DeepLinking when launching app from the deep link should go to a specific menu day',�[39m
�[90m  status: 'failed' })�[39m
detox[76523] TRACE: [ArtifactsManager.js/LIFECYCLE] �[90martifactsManager.onBeforeTerminateApp({ deviceId: '2CF919FD-473E-4386-9EE0-57A0DD2009E1',�[39m
�[90m  bundleId: 'com.myapp.MyApp' })�[39m
detox[76523] DEBUG: [exec.js/EXEC_CMD, #33] �[36m/usr/bin/xcrun simctl terminate 2CF919FD-473E-4386-9EE0-57A0DD2009E1 com.myapp.MyApp�[39m
detox[76523] DEBUG: [exec.js/EXEC_TRY, #33] �[36mTerminating com.myapp.MyApp...�[39m

Any hints on how to resolve this?

It makes it impossible for us to run our tests on CI, as this happens at least 50% of the time.

ReactNative version: 0.59.9 (same thing occurs on 57.6 though)
Xcode version: 10.1
Detox version: 12.11.3
Applesimutils: 0.6.7 (same thing happens on 0.6.6, 0.7)

@support
Copy link

support bot commented Jul 11, 2019

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the detox tag.

Feel free to post your Stack Overflow question here for more visility. We'll take a look at it.

For more information on bots in this reporsitory, read this discussion.

@LeoNatan
Copy link
Contributor

If the simulator is hanging, this is not a Detox issue. Please open a stack overflow question, where we can explore ways to debug this.

@llostris
Copy link
Author

@lock lock bot locked as resolved and limited conversation to collaborators Jul 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants