-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Timeout while attempting to run tests on android emulator #524
Comments
We seem to have the same issue running Detox. The framework looks really good so we'd really like to start using it but are currently stuck on this. |
Same issue here, Detox works perfectly on iOS, however on Android it just opens the first screen and closes immediately, causing timeout of all the tests. We wanted to setup the tests on our CI unix machine, and this is a blocker for us. Setup: |
seems like your apps crashing. Never forget to post your adb logcat output... |
So the app doesn't seem to crash, it's stopping responding actually. Here are the logs: I see now that it seems to have problems connecting to the packager, however it's definitely running in the background. Also, running the app using |
@rotemmiz can you please tell me which version of Detox is currently most stable candidate for Android? At the moment I can't even get the android example (react-native) to run (with latest Detox v.7.0.0-alpha.1) I will really appreciate if you can let me know, because I really want our team to move over to Detox. I would have thought that the Android example on latest branch would work without any problems, but I've already spent all day without success following the instructions on https://github.com/wix/detox/blob/master/docs/More.AndroidSupportStatus.md and https://github.com/wix/detox/blob/master/docs/Introduction.Android.md. I think at the moment the example app does not work because it tries to use Detox v.7.0.0-alpha.1, but Android gradle plugin is still configured to use 2.3.3. But even when I configure the example to use 3.0.0 I'm still hitting various problems. Can you please try and run the latest Android example for react-native (currently set to use Detox v.7.0.0-alpha.1) to see if it actually works? Thanks. |
@anton6 I managed to get detox going today with version 7.0.1 on RN 0.51. Happy to share/dialog if you are still having issues and think it might help. I am running linux 🥇, but it shouldn't make too much difference. |
@juddey Great thanks for that! I'm already setting up Appium at the moment for the company since they think it's more mature, but I am still keen to get detox working so that we can switch to it! I will try 7.0.1 as soon as I get the chance. If I have issues I will message you. Thanks :) |
😔 |
@juddey I'd be happy to hear how did you set it up! |
@juddey I am facing the same issue, when i run detox test -c android.emu.debug , i get error
0 passing (2m)
Version details:
Steps :
Issue - app is getting installed in the emulator, but not launching. adb logcat output is detox test --configuration android.emu.debug --loglevel verbose detox info 13:37:02: server listening on localhost:43149...
0 passing (2m)
0 passing (2m)
child_process.js:644 Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.debug --loglevel verbose |
@rohitpkumar While the error message is the same as what I had, its a catch all message that will fire when the tests fail with a timeout. I suspect that the root cause of what you are seeing is something different. I can't help on this right now, so I'd open a stackoverflow issue tagged with [detox] so someone who has time can help you resolve it. Good luck! 👍 |
Did you create the Android test class? |
@rotemmiz Yes, i have created that. Please find screenshot. |
I'm running into the same error on RN 0.55
The VM is started, the app is also being started - I see that it connects to the packager and downloads the index.html, but it then fails to launch the main activity.
Not sure it is supposed to work at all, since this issue is open: #608, but it for sure works great on RN .55 with iOS emulator. |
Same issue to me. iOS works fine and android is not. Setup: |
what I found is code is stuck in when calling I commented out |
I got this problem on both iOS and Android :( |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The issue has been closed for inactivity. |
I am also facing same issue with Same log which is shared above. (node:76688) ExperimentalWarning: The fs.promises API is experimental detox verb 2: /Users/aditya.pare/Library/Android/sdk/platform-tools/adb devices detox verb 3: /Users/aditya.pare/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop dev.bootcomplete detox verb 4: /Users/aditya.pare/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell input keyevent 82 detox verb 6: /Users/aditya.pare/Library/Android/sdk/platform-tools/adb -s emulator-5554 uninstall com.sephora.mcommerce.test detox verb 7: /Users/aditya.pare/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop ro.build.version.sdk detox verb 8: /Users/aditya.pare/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/aditya.pare/iOS/appofcards/android/app/build/outputs/apk/debug/app-debug.apk detox verb 9: /Users/aditya.pare/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop ro.build.version.sdk detox verb 10: /Users/aditya.pare/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/aditya.pare/iOS/appofcards/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk detox verb 11: /Users/aditya.pare/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am force-stop com.sephora.mcommerce detox verb /Users/aditya.pare/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:58979 -e detoxSessionId 007f086c-37eb-681b-f64f-953905b302f7 -e debug false com.sephora.mcommerce.test/android.support.test.runner.AndroidJUnitRunner
0 passing (2m)
child_process.js:636 Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.debug --loglevel verbose --grep :ios: --invert |
Description
While attempting to run run the tests they are timing out. The emulator does open along with the app and then closes when getting to the first screen. If I run the app alone in the emulator its works perfectly fine
Detox, Node, Device, Xcode and macOS Versions
Steps to Reproduce
Running the following command to run the test:
detox test --loglevel verbose --configuration android.emu.release.
The package json has the following setup
The build.grade has the following addition
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
androidTestCompile(project(path: ":detox", configuration: "oldOkhttpDebug"), {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
exclude group: 'com.squareup.okio', module: 'okio'
Notice I've had to exclude okhttp and okio as this was causing conflicts within my project.
Device and verbose Detox logs
node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.release --loglevel verbose
detox-server info 09:04:38: server listening on localhost:49646...
detox verb ws onOpen [object Object]
detox verb ws send: {"type":"login","params":{"sessionId":"608fcc81-99eb-aa4c-48aa-9f67a87e3de1","role":"tester"},"messageId":0}
detox verb ws onMessage: {"type":"loginSuccess","params":{"sessionId":"608fcc81-99eb-aa4c-48aa-9f67a87e3de1","role":"tester"},"messageId":0}
detox verb ws
detox verb 1: /Users/asbel/Library/Android/sdk/tools/emulator -list-avds --verbose
detox verb 1: stdout: Nexus_5X_API_25
detox verb 1: stdout: Nexus_5X_API_26_x86
detox verb 1: stdout: test
detox verb 1: stdout:
detox verb /Users/asbel/Library/Android/sdk/tools/emulator -verbose -gpu host -no-audio @Nexus_5X_API_25
(node:986) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
detox verb 2: /Users/asbel/Library/Android/sdk/platform-tools/adb devices
detox verb 2: stdout: List of devices attached
detox verb 2: stdout: emulator-5554 device
detox verb 2: stdout:
detox verb 2: stdout:
detox verb 3: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop dev.bootcomplete
detox verb 3: stdout:
detox verb 3: stdout:
detox verb 4: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop dev.bootcomplete
detox verb 4: stdout:
detox verb 4: stdout:
detox verb 5: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop dev.bootcomplete
detox verb 5: stdout:
detox verb 5: stdout:
detox verb 6: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop dev.bootcomplete
detox verb 6: stdout:
detox verb 6: stdout:
detox verb 7: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop dev.bootcomplete
detox verb 7: stdout: 1
detox verb 7: stdout:
detox verb 8: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell input keyevent 82
detox verb 9: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 uninstall com.testapp
detox verb 9: stdout: Success
detox verb 9: stdout:
detox verb 10: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 uninstall com.testapp.test
detox verb 10: stdout: Success
detox verb 10: stdout:
detox verb 11: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/asbel/work/app-discovery/android/app/build/outputs/apk/app-release.apk
detox verb 11: stderr: Success
detox verb 11: stderr:
detox verb 12: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/asbel/work/app-discovery/android/app/build/outputs/apk/app-release-androidTest.apk
detox verb 12: stderr: Success
detox verb 12: stderr:
detox verb 13: /Users/asbel/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am force-stop com.testapp
detox verb adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:49646 -e detoxSessionId 608fcc81-99eb-aa4c-48aa-9f67a87e3de1 -e debug false com.testapp.test/android.support.test.runner.AndroidJUnitRunner
detox verb Instrumentation spawned, childProcess.pid: 1021
detox verb ws send: {"type":"isReady","params":{},"messageId":-1000}
detox verb Instrumentation stdout: INSTRUMENTATION_STATUS: numtests=1
detox verb Instrumentation stdout: INSTRUMENTATION_STATUS: stream=
detox verb Instrumentation stdout: com.testapp.DetoxTest:
detox verb Instrumentation stdout: INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
detox verb Instrumentation stdout: INSTRUMENTATION_STATUS: test=runDetoxTests
detox verb Instrumentation stdout: INSTRUMENTATION_STATUS: class=com.testapp.DetoxTest
detox verb Instrumentation stdout: INSTRUMENTATION_STATUS: current=1
detox verb Instrumentation stdout: INSTRUMENTATION_STATUS_CODE: 1
detox verb Instrumentation stdout:
detox verb Instrumentation stdout: INSTRUMENTATION_RESULT: shortMsg=Process crashed.
detox verb Instrumentation stdout: INSTRUMENTATION_CODE: 0
detox verb Instrumentation stdout:
detox verb instrumentationProcess terminated due to receipt of signal null
0 passing (2m)
1 failing
Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
0 passing (2m)
1 failing
Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
child_process.js:634
throw err;
^
Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.release --loglevel verbose
at checkExecSyncError (child_process.js:591:13)
at Object.execSync (child_process.js:631:13)
at runMocha (/Users/asbel/work/app-discovery/node_modules/detox/local-cli/detox-test.js:61:6)
at Object. (/Users/asbel/work/app-discovery/node_modules/detox/local-cli/detox-test.js:39:5)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Function.Module.runMain (module.js:609:10)
This is the error log from adb logcat
--------- beginning of crash
01-18 09:05:25.214 3635 3875 E AndroidRuntime: FATAL EXCEPTION: com.wix.detox.manager
01-18 09:05:25.214 3635 3875 E AndroidRuntime: Process: com.test.app, PID: 3635
01-18 09:05:25.214 3635 3875 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method setCallWebSocket(Lokhttp3/Call;)V in class Lokhttp3/internal/Internal; or its super classes (declaration of 'okhttp3.internal.Internal' appears in /data/app/com.testapp-1/base.apk)
01-18 09:05:25.214 3635 3875 E AndroidRuntime: at okhttp3.ws.WebSocketCall.enqueue(WebSocketCall.java:108)
01-18 09:05:25.214 3635 3875 E AndroidRuntime: at com.wix.detox.WebSocketClient.connectToServer(WebSocketClient.java:135)
01-18 09:05:25.214 3635 3875 E AndroidRuntime: at com.wix.detox.DetoxManager.start(DetoxManager.java:74)
01-18 09:05:25.214 3635 3875 E AndroidRuntime: at com.wix.detox.Detox$1$1.run(Detox.java:133)
01-18 09:05:25.214 3635 3875 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:751)
01-18 09:05:25.214 3635 3875 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
01-18 09:05:25.214 3635 3875 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
01-18 09:05:25.214 3635 3875 E AndroidRuntime: at com.wix.detox.Detox$1.run(Detox.java:136)
01-18 09:05:25.214 3635 3875 E AndroidRuntime: at java.lang.Thread.run(Thread.java:761)
01-18 09:05:25.218 3635 3875 I Process : Sending signal. PID: 3635 SIG: 9
01-18 09:05:25.223 4156 4174 D ApplicationLoaders: ignored Vulkan layer search path /system/priv-app/PrebuiltGmsCore/lib/x86:/system/fake-libs:/system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/x86:/system/lib:/vendor/lib for namespace 0xaaff7090
01-18 09:05:25.258 4156 4177 W System : ClassLoader referenced unknown path:
01-18 09:05:25.258 4156 4177 W System : ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
01-18 09:05:25.267 1697 1880 I WindowManager: WIN DEATH: Window{7bd2d4c u0 com.testapp/com.reactnativenavigation.controllers.NavigationActivity}
01-18 09:05:25.267 1697 1708 D GraphicsStats: Buffer count: 3
01-18 09:05:25.267 1337 3959 D : HostConnection::get() New Host Connection established 0xb333abc0, tid 3959
01-18 09:05:25.267 1697 1708 I ActivityManager: Process com.testapp (pid 3635) has died
01-18 09:05:25.267 1697 1708 D ActivityManager: cleanUpApplicationRecord -- 3635
01-18 09:05:25.269 1697 1735 W InputDispatcher: channel 'bde3968 com.testapp/com.reactnativenavigation.controllers.NavigationActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
01-18 09:05:25.269 1697 1735 E InputDispatcher: channel 'bde3968 com.testapp/com.reactnativenavigation.controllers.NavigationActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-18 09:05:25.273 1403 4182 W SocketClient: write error (Broken pipe)
01-18 09:05:25.273 1403 4183 W SocketClient: write error (Broken pipe)
01-18 09:05:25.273 1403 4182 W DnsProxyListener: Error writing DNS result to client
01-18 09:05:25.273 1403 4183 W DnsProxyListener: Error writing DNS result to client
01-18 09:05:25.274 1697 1708 W ActivityManager: Force removing ActivityRecord{99ec8d u0 com.testapp/com.reactnativenavigation.controllers.NavigationActivity t6}: app died, no saved state
01-18 09:05:25.275 1697 1935 I WindowManager: WIN DEATH: Window{bde3968 u0 com.testapp/com.reactnativenavigation.controllers.NavigationActivity}
01-18 09:05:25.275 1697 1935 W InputDispatcher: Attempted to unregister already unregistered input channel 'bde3968 com.testapp/com.reactnativenavigation.controllers.NavigationActivity (server)'
01-18 09:05:25.280 1697 1708 W ActivityManager: Crash of app com.testapp running instrumentation ComponentInfo{com.testapp.test/android.support.test.runner.AndroidJUnitRunner}
01-18 09:05:25.281 4156 4177 D ApplicationLoaders: ignored Vulkan layer search path /system/priv-app/PrebuiltGmsCore/lib/x86:/system/fake-libs:/system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/x86:/system/lib:/vendor/lib for namespace 0xaaff70d0
The text was updated successfully, but these errors were encountered: