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

Android. Detox can't seem to connect to the test app(s)! #3598

Closed
2 tasks done
olexanderPotebenko opened this issue Sep 18, 2022 · 3 comments
Closed
2 tasks done

Android. Detox can't seem to connect to the test app(s)! #3598

olexanderPotebenko opened this issue Sep 18, 2022 · 3 comments

Comments

@olexanderPotebenko
Copy link

olexanderPotebenko commented Sep 18, 2022

What happened?

The application starts but then fails the tests:

Detox can't seem to connect to the test app(s)!

HINT:

The test app might have crashed prematurely, or has had trouble setting up the connection.
Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs

What was the expected behaviour?

Connecting "detox" to the application and successfully passing the tests

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

It is my repository https://github.com/olexanderPotebenko/mobileTestDetox.git

In what environment did this happen?

Detox version: 19.7.1
React Native version: 0.69.5
Node version: 14.20.0
Device model: Pixel XL 5.5 1440x2560 560dpi
Android version: 12.0 x86_64
Test-runner (select one): jest-circus

Detox logs

Detox logs 23:06:46.051 detox[42840] INFO: [test.js] DETOX_CONFIGURATION="android.emu.release" DETOX_LOGLEVEL="trace" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1663531606045 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' e2e Debugger listening on ws://127.0.0.1:33687/860c668f-41bb-4afe-ad0c-cac6270f1af8 For help, see: https://nodejs.org/en/docs/inspector Debugger attached. 23:06:47.953 detox[42852] TRACE: [DETOX_CREATE] created a Detox instance with config: { appsConfig: { default: { type: 'android.apk', binaryPath: 'android/app/build/outputs/apk/release/app-release.apk', build: 'cd android && ./gradlew --no-daemon assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..' } }, artifactsConfig: { rootDir: 'artifacts/android.emu.release.2022-09-18 20-06-46Z', plugins: { log: { enabled: false, keepOnlyFailedTestsArtifacts: false }, screenshot: { enabled: true, shouldTakeAutomaticSnapshots: false, keepOnlyFailedTestsArtifacts: false }, video: { enabled: false, keepOnlyFailedTestsArtifacts: false }, instruments: { enabled: false, keepOnlyFailedTestsArtifacts: false }, timeline: { enabled: false }, uiHierarchy: { enabled: false, keepOnlyFailedTestsArtifacts: false } }, pathBuilder: ArtifactPathBuilder { _rootDir: 'artifacts/android.emu.release.2022-09-18 20-06-46Z' } }, behaviorConfig: { init: { reinstallApp: true, exposeGlobals: true }, cleanup: { shutdownDevice: false }, launchApp: 'auto' }, cliConfig: { configuration: 'android.emu.release', loglevel: 'trace', useCustomLogger: true }, configurationName: 'android.emu.release', deviceConfig: { type: 'android.emulator', device: { avdName: 'Pixel_XL_API_31' } }, runnerConfig: { testRunner: 'jest', runnerConfig: 'e2e/config.json', specs: 'e2e', skipLegacyWorkersInjection: true }, sessionConfig: { autoStart: true, sessionId: 'f570872f-947d-9f85-9843-41d2f5d30664', debugSynchronization: 10000 } } 23:06:47.958 detox[42852] DEBUG: [WSS_CREATE] Detox server listening on localhost:34069... 23:06:47.972 detox[42852] DEBUG: [WSS_CONNECTION, #60340] registered a new connection. 23:06:47.982 detox[42852] TRACE: [WS_OPEN] opened web socket to: ws://localhost:34069 23:06:47.984 detox[42852] TRACE: [WS_SEND] {"type":"login","params":{"sessionId":"f570872f-947d-9f85-9843-41d2f5d30664","role":"tester"},"messageId":0} 23:06:47.986 detox[42852] TRACE: [WSS_GET_FROM, #60340] {"type":"login","params":{"sessionId":"f570872f-947d-9f85-9843-41d2f5d30664","role":"tester"},"messageId":0} 23:06:47.986 detox[42852] TRACE: [SESSION_CREATED] created session f570872f-947d-9f85-9843-41d2f5d30664 23:06:47.987 detox[42852] TRACE: [WSS_SEND_TO, #tester] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0} 23:06:47.987 detox[42852] TRACE: [SESSION_JOINED] tester joined session f570872f-947d-9f85-9843-41d2f5d30664 23:06:47.988 detox[42852] TRACE: [WS_MESSAGE] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0}

23:06:48.042 detox[42852] DEBUG: [EXEC_CMD, #0] "/home/x/Android/Sdk/emulator/emulator" -list-avds --verbose
23:06:48.058 detox[42852] TRACE: [EXEC_SUCCESS, #0] Pixel_XL_API_31

23:06:48.059 detox[42852] DEBUG: [EXEC_CMD, #1] "/home/x/Android/Sdk/emulator/emulator" -version
23:06:48.103 detox[42852] TRACE: [EXEC_SUCCESS, #1] Android emulator version 31.2.10.0 (build_id 8420304) (CL:N/A)
Copyright (C) 2006-2017 The Android Open Source Project and many others.
This program is a derivative of the QEMU CPU emulator (www.qemu.org).

This software is licensed under the terms of the GNU General Public
License version 2, as published by the Free Software Foundation, and
may be copied, distributed, and modified under those terms.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

23:06:48.104 detox[42852] DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 31, minor: 2, patch: 10, toString: [Function: toString] }
23:06:48.104 detox[42852] DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "Pixel_XL_API_31"
23:06:48.106 detox[42852] DEBUG: [EXEC_CMD, #2] "/home/x/Android/Sdk/platform-tools/adb" devices
23:06:48.117 detox[42852] DEBUG: [EXEC_SUCCESS, #2] List of devices attached
emulator-17622 device

23:06:48.119 detox[42852] TRACE: [TELNET_CONNECTING] port: 17622, host: localhost
23:06:48.124 detox[42852] DEBUG: [DEVICE_LOOKUP] Found a matching & free device emulator-17622
23:06:48.127 detox[42852] DEBUG: [ALLOCATE_DEVICE] Settled on emulator-17622
23:06:48.133 detox[42852] DEBUG: [EXEC_CMD, #3] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "getprop dev.bootcomplete"
23:06:48.166 detox[42852] TRACE: [EXEC_SUCCESS, #3] 1

23:06:48.167 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBootDevice({
deviceId: 'emulator-17622',
type: 'Pixel_XL_API_31',
coldBoot: false
})
23:06:48.168 detox[42852] DEBUG: [EXEC_CMD, #4] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "getprop ro.build.version.sdk"
23:06:48.197 detox[42852] TRACE: [EXEC_SUCCESS, #4] 31

23:06:48.197 detox[42852] DEBUG: [EXEC_CMD, #5] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "settings put global animator_duration_scale 0"
23:06:48.245 detox[42852] TRACE: [EXEC_SUCCESS, #5]
23:06:48.246 detox[42852] DEBUG: [EXEC_CMD, #6] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "settings put global window_animation_scale 0"
23:06:48.272 detox[42852] TRACE: [EXEC_SUCCESS, #6]
23:06:48.273 detox[42852] DEBUG: [EXEC_CMD, #7] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "settings put global transition_animation_scale 0"
23:06:48.315 detox[42852] TRACE: [EXEC_SUCCESS, #7]
23:06:48.316 detox[42852] DEBUG: [EXEC_CMD, #8] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "dumpsys power | grep "^[ ]m[UW].=""
23:06:48.397 detox[42852] TRACE: [EXEC_SUCCESS, #8] mWakefulness=Awake
mWakefulnessChanging=false
mWakeLockSummary=0x0
mWakeUpWhenPluggedOrUnpluggedConfig=false
mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false
mUserActivityTimeoutOverrideFromWindowManager=-1
mUserInactiveOverrideFromWindowManager=false
mUserId=0
mWakeLockSummary=0x0
mUserInteractionBackoffMillis=60000

23:06:48.411 detox[42852] DEBUG: [EXEC_CMD, #9] "/home/x/Android/Sdk/build-tools/33.0.0/aapt" dump badging "/home/x/Documents/work-projects/USKAPE/loop-mobile/android/app/build/outputs/apk/release/app-release.apk"
23:06:48.422 detox[42852] TRACE: [EXEC_SUCCESS, #9] package: name='com.loopmobile' versionCode='1' versionName='1.0' platformBuildVersionName='12' platformBuildVersionCode='31' compileSdkVersion='31' compileSdkVersionCodename='12'
sdkVersion:'21'
targetSdkVersion:'31'
uses-permission: name='android.permission.INTERNET'
application-label:'loopMobile'
application-label-af:'loopMobile'
application-label-am:'loopMobile'
application-label-ar:'loopMobile'
application-label-as:'loopMobile'
application-label-az:'loopMobile'
application-label-be:'loopMobile'
application-label-bg:'loopMobile'
application-label-bn:'loopMobile'
application-label-bs:'loopMobile'
application-label-ca:'loopMobile'
application-label-cs:'loopMobile'
application-label-da:'loopMobile'
application-label-de:'loopMobile'
application-label-el:'loopMobile'
application-label-en-AU:'loopMobile'
application-label-en-CA:'loopMobile'
application-label-en-GB:'loopMobile'
application-label-en-IN:'loopMobile'
application-label-en-XC:'loopMobile'
application-label-es:'loopMobile'
application-label-es-US:'loopMobile'
application-label-et:'loopMobile'
application-label-eu:'loopMobile'
application-label-fa:'loopMobile'
application-label-fi:'loopMobile'
application-label-fr:'loopMobile'
application-label-fr-CA:'loopMobile'
application-label-gl:'loopMobile'
application-label-gu:'loopMobile'
application-label-hi:'loopMobile'
application-label-hr:'loopMobile'
application-label-hu:'loopMobile'
application-label-hy:'loopMobile'
application-label-in:'loopMobile'
application-label-is:'loopMobile'
application-label-it:'loopMobile'
application-label-iw:'loopMobile'
application-label-ja:'loopMobile'
application-label-ka:'loopMobile'
application-label-kk:'loopMobile'
application-label-km:'loopMobile'
application-label-kn:'loopMobile'
application-label-ko:'loopMobile'
application-label-ky:'loopMobile'
application-label-lo:'loopMobile'
application-label-lt:'loopMobile'
application-label-lv:'loopMobile'
application-label-mk:'loopMobile'
application-label-ml:'loopMobile'
application-label-mn:'loopMobile'
application-label-mr:'loopMobile'
application-label-ms:'loopMobile'
application-label-my:'loopMobile'
application-label-nb:'loopMobile'
application-label-ne:'loopMobile'
application-label-nl:'loopMobile'
application-label-or:'loopMobile'
application-label-pa:'loopMobile'
application-label-pl:'loopMobile'
application-label-pt:'loopMobile'
application-label-pt-BR:'loopMobile'
application-label-pt-PT:'loopMobile'
application-label-ro:'loopMobile'
application-label-ru:'loopMobile'
application-label-si:'loopMobile'
application-label-sk:'loopMobile'
application-label-sl:'loopMobile'
application-label-sq:'loopMobile'
application-label-sr:'loopMobile'
application-label-sr-Latn:'loopMobile'
application-label-sv:'loopMobile'
application-label-sw:'loopMobile'
application-label-ta:'loopMobile'
application-label-te:'loopMobile'
application-label-th:'loopMobile'
application-label-tl:'loopMobile'
application-label-tr:'loopMobile'
application-label-uk:'loopMobile'
application-label-ur:'loopMobile'
application-label-uz:'loopMobile'
application-label-vi:'loopMobile'
application-label-zh-CN:'loopMobile'
application-label-zh-HK:'loopMobile'
application-label-zh-TW:'loopMobile'
application-label-zu:'loopMobile'
application-icon-160:'res/u3.png'
application-icon-240:'res/SD.png'
application-icon-320:'res/jy.png'
application-icon-480:'res/D2.png'
application-icon-640:'res/CG.png'
application-icon-65534:'res/u3.png'
application: label='loopMobile' icon='res/u3.png'
launchable-activity: name='com.loopmobile.MainActivity' label='loopMobile' icon=''
feature-group: label=''
uses-feature: name='android.hardware.faketouch'
uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'
main
other-activities
other-services
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--' 'af' 'am' 'ar' 'as' 'az' 'be' 'bg' 'bn' 'bs' 'ca' 'cs' 'da' 'de' 'el' 'en-AU' 'en-CA' 'en-GB' 'en-IN' 'en-XC' 'es' 'es-US' 'et' 'eu' 'fa' 'fi' 'fr' 'fr-CA' 'gl' 'gu' 'hi' 'hr' 'hu' 'hy' 'in' 'is' 'it' 'iw' 'ja' 'ka' 'kk' 'km' 'kn' 'ko' 'ky' 'lo' 'lt' 'lv' 'mk' 'ml' 'mn' 'mr' 'ms' 'my' 'nb' 'ne' 'nl' 'or' 'pa' 'pl' 'pt' 'pt-BR' 'pt-PT' 'ro' 'ru' 'si' 'sk' 'sl' 'sq' 'sr' 'sr-Latn' 'sv' 'sw' 'ta' 'te' 'th' 'tl' 'tr' 'uk' 'ur' 'uz' 'vi' 'zh-CN' 'zh-HK' 'zh-TW' 'zu'
densities: '160' '240' '320' '480' '640' '65534'
native-code: 'arm64-v8a' 'armeabi-v7a' 'x86' 'x86_64'

23:06:48.440 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-17622', bundleId: 'com.loopmobile' })
23:06:48.441 detox[42852] DEBUG: [EXEC_CMD, #10] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "am force-stop com.loopmobile"
23:06:48.482 detox[42852] TRACE: [EXEC_SUCCESS, #10]
23:06:48.483 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({ deviceId: 'emulator-17622', bundleId: 'com.loopmobile' })
23:06:48.484 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeUninstallApp({ deviceId: 'emulator-17622', bundleId: 'com.loopmobile' })
23:06:48.484 detox[42852] DEBUG: [EXEC_CMD, #11] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "pm list packages com.loopmobile"
23:06:48.513 detox[42852] TRACE: [EXEC_SUCCESS, #11] package:com.loopmobile.test
package:com.loopmobile

23:06:48.513 detox[42852] DEBUG: [EXEC_CMD, #12] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 uninstall com.loopmobile
23:06:48.694 detox[42852] TRACE: [EXEC_SUCCESS, #12] Success

23:06:48.695 detox[42852] DEBUG: [EXEC_CMD, #13] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "pm list packages com.loopmobile.test"
23:06:48.832 detox[42852] TRACE: [EXEC_SUCCESS, #13] package:com.loopmobile.test

23:06:48.832 detox[42852] DEBUG: [EXEC_CMD, #14] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 uninstall com.loopmobile.test
23:06:49.092 detox[42852] TRACE: [EXEC_SUCCESS, #14] Success

23:06:49.093 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-17622', bundleId: 'com.loopmobile' })
23:06:49.094 detox[42852] DEBUG: [EXEC_CMD, #15] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "am force-stop com.loopmobile"
23:06:49.145 detox[42852] TRACE: [EXEC_SUCCESS, #15]
23:06:49.146 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({ deviceId: 'emulator-17622', bundleId: 'com.loopmobile' })
23:06:49.147 detox[42852] DEBUG: [EXEC_CMD, #16] "/home/x/Android/Sdk/build-tools/33.0.0/aapt" dump xmlstrings "/home/x/Documents/work-projects/USKAPE/loop-mobile/android/app/build/outputs/apk/release/app-release.apk" AndroidManifest.xml
23:06:49.156 detox[42852] TRACE: [EXEC_SUCCESS, #16] String pool of 58 unique UTF-16 non-sorted strings, 58 entries and 0 styles using 2864 bytes:
String #0: theme
String #1: label
String #2: icon
String #3: name
String #4: permission
String #5: exported
String #6: excludeFromRecents
String #7: authorities
String #8: launchMode
String #9: configChanges
String #10: value
String #11: minSdkVersion
String #12: versionCode
String #13: versionName
String #14: windowSoftInputMode
String #15: targetSdkVersion
String #16: allowBackup
String #17: roundIcon
String #18: visibleToInstantApps
String #19: compileSdkVersion
String #20: compileSdkVersionCodename
String #21: appComponentFactory
String #22: android:networkSecurityConfig="@xml/network_security_config">
String #23: 1.0
String #24: 12
String #25: action
String #26: activity
String #27: android
String #28: android.intent.action.MAIN
String #29: android.intent.category.LAUNCHER
String #30: android.permission.INTERNET
String #31: androidx.core.app.CoreComponentFactory
String #32: androidx.emoji2.text.EmojiCompatInitializer
String #33: androidx.lifecycle.ProcessLifecycleInitializer
String #34: androidx.startup
String #35: androidx.startup.InitializationProvider
String #36: application
String #37: category
String #38: com.google.android.gms.auth.api.signin.RevocationBoundService
String #39: com.google.android.gms.auth.api.signin.internal.SignInHubActivity
String #40: com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION
String #41: com.google.android.gms.common.api.GoogleApiActivity
String #42: com.google.android.gms.version
String #43: com.loopmobile
String #44: com.loopmobile.MainActivity
String #45: com.loopmobile.MainApplication
String #46: com.loopmobile.androidx-startup
String #47: http://schemas.android.com/apk/res/android
String #48: intent-filter
String #49: manifest
String #50: meta-data
String #51: package
String #52: platformBuildVersionCode
String #53: platformBuildVersionName
String #54: provider
String #55: service
String #56: uses-permission
String #57: uses-sdk

23:06:49.160 detox[42852] DEBUG: [EXEC_CMD, #17] "/home/x/Android/Sdk/build-tools/33.0.0/aapt" dump xmlstrings "/home/x/Documents/work-projects/USKAPE/loop-mobile/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk" AndroidManifest.xml
23:06:49.171 detox[42852] TRACE: [EXEC_SUCCESS, #17] String pool of 40 unique UTF-16 non-sorted strings, 40 entries and 0 styles using 2000 bytes:
String #0: theme
String #1: label
String #2: name
String #3: exported
String #4: targetPackage
String #5: handleProfiling
String #6: functionalTest
String #7: minSdkVersion
String #8: targetSdkVersion
String #9: compileSdkVersion
String #10: compileSdkVersionCodename
String #11: 12
String #12: Tests for com.loopmobile
String #13: action
String #14: activity
String #15: android
String #16: android.intent.action.MAIN
String #17: android.permission.REORDER_TASKS
String #18: android.test.runner
String #19: androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity
String #20: androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity
String #21: androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity
String #22: androidx.test.orchestrator
String #23: androidx.test.runner.AndroidJUnitRunner
String #24: androidx.test.services
String #25: application
String #26: com.google.android.apps.common.testing.services
String #27: com.loopmobile
String #28: com.loopmobile.test
String #29: http://schemas.android.com/apk/res/android
String #30: instrumentation
String #31: intent-filter
String #32: manifest
String #33: package
String #34: platformBuildVersionCode
String #35: platformBuildVersionName
String #36: queries
String #37: uses-library
String #38: uses-permission
String #39: uses-sdk

23:06:49.172 detox[42852] DEBUG: [EXEC_CMD, #18] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "rm -fr /data/local/tmp/detox"
23:06:49.223 detox[42852] TRACE: [EXEC_SUCCESS, #18]
23:06:49.224 detox[42852] DEBUG: [EXEC_CMD, #19] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "mkdir -p /data/local/tmp/detox"
23:06:49.278 detox[42852] TRACE: [EXEC_SUCCESS, #19]
23:06:49.279 detox[42852] DEBUG: [EXEC_CMD, #20] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 push "/home/x/Documents/work-projects/USKAPE/loop-mobile/android/app/build/outputs/apk/release/app-release.apk" "/data/local/tmp/detox/Application.apk"
23:06:49.542 detox[42852] TRACE: [EXEC_SUCCESS, #20] /home/x/Documents/work-projects/USKAPE/loop-mobile/android/app/build/outputs/apk/release/app-release.apk: 1 file pushed, 0 skipped. 115.0 MB/s (26592274 bytes in 0.221s)

23:06:49.549 detox[42852] DEBUG: [SPAWN_CMD, #21, cpid=42998] /home/x/Android/Sdk/platform-tools/adb -s emulator-17622 shell pm install -r -g -t /data/local/tmp/detox/Application.apk
23:06:50.291 detox[42852] TRACE: [SPAWN_STDOUT, #21, cpid=42998] Success

23:06:50.293 detox[42852] DEBUG: [SPAWN_END, #21, cpid=42998] /home/x/Android/Sdk/platform-tools/adb -s emulator-17622 shell pm install -r -g -t /data/local/tmp/detox/Application.apk exited with code #0
23:06:50.293 detox[42852] DEBUG: [EXEC_CMD, #22] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 push "/home/x/Documents/work-projects/USKAPE/loop-mobile/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk" "/data/local/tmp/detox/Test.apk"
23:06:50.329 detox[42852] TRACE: [EXEC_SUCCESS, #22] /home/x/Documents/work-projects/USKAPE/loop-mobile/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk: 1 file pushed, 0 skipped. 263.2 MB/s (1838913 bytes in 0.007s)

23:06:50.335 detox[42852] DEBUG: [SPAWN_CMD, #23, cpid=43002] /home/x/Android/Sdk/platform-tools/adb -s emulator-17622 shell pm install -r -g -t /data/local/tmp/detox/Test.apk
23:06:50.807 detox[42852] TRACE: [SPAWN_STDOUT, #23, cpid=43002] Success

23:06:50.809 detox[42852] DEBUG: [SPAWN_END, #23, cpid=43002] /home/x/Android/Sdk/platform-tools/adb -s emulator-17622 shell pm install -r -g -t /data/local/tmp/detox/Test.apk exited with code #0
23:06:51.300 ROOT_DESCRIBE_BLOCK[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeStart({ name: 'ROOT_DESCRIBE_BLOCK' })
23:06:51.301 Example[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeStart({ name: 'Example' })
23:06:51.302 detox[42852] INFO: Example is assigned to emulator-17622 (Pixel_XL_API_31)
23:06:51.303 detox[42852] INFO: at e2e/firstTest.e2e.js:7:13
LAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHING
23:06:51.306 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-17622', bundleId: 'com.loopmobile' })
23:06:51.306 detox[42852] DEBUG: [EXEC_CMD, #24] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "am force-stop com.loopmobile"
23:06:51.340 detox[42852] TRACE: [EXEC_SUCCESS, #24]
23:06:51.340 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({ deviceId: 'emulator-17622', bundleId: 'com.loopmobile' })
23:06:51.341 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeLaunchApp({
deviceId: 'emulator-17622',
bundleId: 'com.loopmobile',
launchArgs: {
detoxServer: 'ws://localhost:34069',
detoxSessionId: 'f570872f-947d-9f85-9843-41d2f5d30664'
}
})
23:06:51.341 detox[42852] DEBUG: [EXEC_CMD, #25] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "date +"%m-%d %T.000""
23:06:51.367 detox[42852] TRACE: [EXEC_SUCCESS, #25] 09-18 23:06:43.000

23:06:51.368 detox[42852] DEBUG: [EXEC_CMD, #26] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 reverse tcp:34069 tcp:34069
23:06:51.378 detox[42852] TRACE: [EXEC_SUCCESS, #26] 34069

23:06:51.380 detox[42852] DEBUG: [EXEC_CMD, #27] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "pm list instrumentation"
23:06:51.411 detox[42852] TRACE: [EXEC_SUCCESS, #27] instrumentation:com.loopmobile.test/androidx.test.runner.AndroidJUnitRunner (target=com.loopmobile)

23:06:51.419 detox[42852] DEBUG: [SPAWN_CMD, #28, cpid=43015] /home/x/Android/Sdk/platform-tools/adb -s emulator-17622 shell am instrument -w -r -e detoxServer ws://localhost:34069 -e detoxSessionId f570872f-947d-9f85-9843-41d2f5d30664 -e debug false com.loopmobile.test/androidx.test.runner.AndroidJUnitRunner
23:06:51.920 detox[42852] DEBUG: [EXEC_CMD, #29] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 shell "ps | grep "com.loopmobile$""
23:06:52.048 detox[42852] TRACE: [EXEC_SUCCESS, #29] u0_a215 13316 312 13730300 86200 0 0 S com.loopmobile

23:06:52.049 detox[13316] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onLaunchApp({
deviceId: 'emulator-17622',
bundleId: 'com.loopmobile',
launchArgs: {
detoxServer: 'ws://localhost:34069',
detoxSessionId: 'f570872f-947d-9f85-9843-41d2f5d30664'
},
pid: 13316
})
23:06:52.235 detox[42852] TRACE: [SPAWN_STDOUT, #28, cpid=43015] INSTRUMENTATION_STATUS: class=com.loopmobile.DetoxTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
23:06:52.236 detox[42852] TRACE: [SPAWN_STDOUT, #28, cpid=43015]
INSTRUMENTATION_STATUS: stream=
com.loopmobile.DetoxTest:
INSTRUMENTATION_STATUS: test=runDetoxTests
INSTRUMENTATION_STATUS_CODE: 1

23:08:51.306 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onHookFailure({
error: 'Exceeded timeout of 120000 ms for a hook.\n' +
'Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.',
hook: 'beforeAll'
})
23:08:51.309 detox[42852] INFO: Example: should have welcome screen
23:08:51.314 detox[42852] INFO: Example: should have welcome screen [FAIL]
23:08:51.320 detox[42852] INFO: Example: should show hello screen after tap
23:08:51.320 detox[42852] INFO: Example: should show hello screen after tap [FAIL]
23:08:51.321 detox[42852] INFO: Example: should show world screen after tap
23:08:51.322 detox[42852] INFO: Example: should show world screen after tap [FAIL]
23:08:51.323 Example[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'Example' })

23:08:51.324 ROOT_DESCRIBE_BLOCK[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'ROOT_DESCRIBE_BLOCK' })
23:08:51.343 detox[42852] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeCleanup()
23:08:51.345 detox[42852] ERROR: [APP_UNREACHABLE] Detox can't seem to connect to the test app(s)!

HINT:

The test app might have crashed prematurely, or has had trouble setting up the connection.
Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs

23:08:51.352 detox[42852] TRACE: [SESSION_TORN] tester exited session f570872f-947d-9f85-9843-41d2f5d30664
23:08:51.352 detox[43015] TRACE: [SPAWN_KILL] sending SIGINT to: /home/x/Android/Sdk/platform-tools/adb -s emulator-17622 shell am instrument -w -r -e detoxServer ws://localhost:34069 -e detoxSessionId f570872f-947d-9f85-9843-41d2f5d30664 -e debug false com.loopmobile.test/androidx.test.runner.AndroidJUnitRunner
23:08:51.354 detox[42852] DEBUG: [SPAWN_END, #28, cpid=43015] /home/x/Android/Sdk/platform-tools/adb -s emulator-17622 shell am instrument -w -r -e detoxServer ws://localhost:34069 -e detoxSessionId f570872f-947d-9f85-9843-41d2f5d30664 -e debug false com.loopmobile.test/androidx.test.runner.AndroidJUnitRunner terminated with SIGINT
23:08:51.354 detox[42852] DEBUG: [EXEC_CMD, #30] "/home/x/Android/Sdk/platform-tools/adb" -s emulator-17622 reverse --remove tcp:34069
23:08:51.364 detox[42852] DEBUG: [WSS_CLOSE] Detox server has been closed gracefully
FAIL e2e/firstTest.e2e.js (124.138 s)
Example
✕ should have welcome screen (3 ms)
✕ should show hello screen after tap (1 ms)
✕ should show world screen after tap (2 ms)

● Example › should have welcome screen

thrown: "Exceeded timeout of 120000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  1 | describe('Example', () => {
> 2 |   beforeAll(async () => {
    |   ^
  3 |     console.log('LAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHING')
  4 |     await device.launchApp();
  5 |     console.log('LAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHING')

  at firstTest.e2e.js:2:3
  at Object.<anonymous> (firstTest.e2e.js:1:1)

● Example › should show hello screen after tap

thrown: "Exceeded timeout of 120000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  1 | describe('Example', () => {
> 2 |   beforeAll(async () => {
    |   ^
  3 |     console.log('LAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHING')
  4 |     await device.launchApp();
  5 |     console.log('LAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHING')

  at firstTest.e2e.js:2:3
  at Object.<anonymous> (firstTest.e2e.js:1:1)

● Example › should show world screen after tap

thrown: "Exceeded timeout of 120000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  1 | describe('Example', () => {
> 2 |   beforeAll(async () => {
    |   ^
  3 |     console.log('LAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHING')
  4 |     await device.launchApp();
  5 |     console.log('LAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHINGLAUNCHING')

  at firstTest.e2e.js:2:3
  at Object.<anonymous> (firstTest.e2e.js:1:1)

23:08:51.378 detox[42852] TRACE: [EXEC_SUCCESS, #30]
Waiting for the debugger to disconnect...
23:08:51.533 detox[42840] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' e2e

paste logs here!

Device logs

Device logs

23:41:14.650 detox[45811] INFO: [test.js] DETOX_CONFIGURATION="android.emu.release" DETOX_RECORD_LOGS="all" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1663533674645 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' e2e
Debugger listening on ws://127.0.0.1:34911/45aba7bd-5102-4903-a76e-11cf582e9582
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
23:41:31.522 detox[45828] ERROR: Exceeded timeout of 15000ms while handling jest-circus "setup" event
23:41:32.042 detox[45828] INFO: Example is assigned to undefined
23:41:32.043 detox[45828] INFO: Example: should have welcome screen
23:41:32.044 detox[45828] INFO: Example: should have welcome screen [FAIL]
23:41:32.045 detox[45828] INFO: Example: should show hello screen after tap
23:41:32.046 detox[45828] INFO: Example: should show hello screen after tap [FAIL]
23:41:32.046 detox[45828] INFO: Example: should show world screen after tap
23:41:32.047 detox[45828] INFO: Example: should show world screen after tap [FAIL]

23:41:32.059 detox[45828] ERROR: Aborted detox.init() execution, and now running detox.cleanup()

HINT: Most likely, your test runner is tearing down the suite due to the timeout error
FAIL e2e/firstTest.e2e.js (16.303 s)
● Example › should have welcome screen

Environment setup failed. See the detailed error below.

● Example › should show hello screen after tap

Environment setup failed. See the detailed error below.

● Example › should show world screen after tap

Environment setup failed. See the detailed error below.

● Test suite failed to run

Exceeded timeout of 15000ms while handling jest-circus "setup" event

23:41:33.127 detox[45828] WARN: at node_modules/jest-cli/build/cli/index.js:261:15
Jest did not exit one second after the test run has completed.

This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with --detectOpenHandles to troubleshoot this issue.

More data, please!

adb logcat tocol=6 09-19 13:11:46.107 311 18120 D resolv : explore_numeric_scope 09-19 13:11:46.107 311 18120 D resolv : android_getaddrinfofornetcontext: explore_numeric: ai_family=2 ai_socktype=1 ai_protocol=6 09-19 13:11:46.107 311 18120 D resolv : explore_numeric_scope 09-19 13:11:46.107 311 18120 I ResolverController: No valid NAT64 prefix (112, /0) 09-19 13:11:49.109 17404 18119 D DetoxWSClient: Retrying... 09-19 13:11:49.109 17404 18119 I DetoxWSClient: At connectToServer 09-19 13:11:49.115 311 18122 D resolv : GetAddrInfoHandler::run: {112 112 112 983152 10220 0} 09-19 13:11:49.115 311 18122 D resolv : resolv_getaddrinfo: explore_fqdn(): ai_family=0 ai_socktype=1 ai_protocol=6 09-19 13:11:49.115 311 18122 D resolv : android_getaddrinfofornetcontext: explore_numeric: ai_family=10 ai_socktype=1 ai_protocol=6 09-19 13:11:49.115 311 18122 D resolv : explore_numeric_scope 09-19 13:11:49.115 311 18122 D resolv : android_getaddrinfofornetcontext: explore_numeric: ai_family=2 ai_socktype=1 ai_protocol=6 09-19 13:11:49.115 311 18122 D resolv : explore_numeric_scope 09-19 13:11:49.115 311 18122 I ResolverController: No valid NAT64 prefix (112, /0) 09-19 13:11:52.117 17404 18121 D DetoxWSClient: Retrying... 09-19 13:11:52.118 17404 18121 I DetoxWSClient: At connectToServer 09-19 13:11:52.131 311 18124 D resolv : GetAddrInfoHandler::run: {112 112 112 983152 10220 0} 09-19 13:11:52.131 311 18124 D resolv : resolv_getaddrinfo: explore_fqdn(): ai_family=0 ai_socktype=1 ai_protocol=6 09-19 13:11:52.131 311 18124 D resolv : android_getaddrinfofornetcontext: explore_numeric: ai_family=10 ai_socktype=1 ai_protocol=6 09-19 13:11:52.131 311 18124 D resolv : explore_numeric_scope 09-19 13:11:52.132 311 18124 D resolv : android_getaddrinfofornetcontext: explore_numeric: ai_family=2 ai_socktype=1 ai_protocol=6 09-19 13:11:52.132 311 18124 D resolv : explore_numeric_scope 09-19 13:11:52.132 311 18124 I ResolverController: No valid NAT64 prefix (112, /0) 09-19 13:11:55.133 17404 18123 D DetoxWSClient: Retrying... 09-19 13:11:55.134 17404 18123 I DetoxWSClient: At connectToServer 09-19 13:11:55.139 311 18126 D resolv : GetAddrInfoHandler::run: {112 112 112 983152 10220 0} 09-19 13:11:55.139 311 18126 D resolv : resolv_getaddrinfo: explore_fqdn(): ai_family=0 ai_socktype=1 ai_protocol=6 09-19 13:11:55.139 311 18126 D resolv : android_getaddrinfofornetcontext: explore_numeric: ai_family=10 ai_socktype=1 ai_protocol=6 09-19 13:11:55.139 311 18126 D resolv : explore_numeric_scope 09-19 13:11:55.139 311 18126 D resolv : android_getaddrinfofornetcontext: explore_numeric: ai_family=2 ai_socktype=1 ai_protocol=6 09-19 13:11:55.139 311 18126 D resolv : explore_numeric_scope 09-19 13:11:55.140 311 18126 I ResolverController: No valid NAT64 prefix (112, /0) 09-19 13:11:58.142 17404 18125 D DetoxWSClient: Retrying... 09-19 13:11:58.142 17404 18125 I DetoxWSClient: At connectToServer 09-19 13:11:58.147 311 18128 D resolv : GetAddrInfoHandler::run: {112 112 112 983152 10220 0} 09-19 13:11:58.147 311 18128 D resolv : resolv_getaddrinfo: explore_fqdn(): ai_family=0 ai_socktype=1 ai_protocol=6 09-19 13:11:58.147 311 18128 D resolv : android_getaddrinfofornetcontext: explore_numeric: ai_family=10 ai_socktype=1 ai_protocol=6 09-19 13:11:58.147 311 18128 D resolv : explore_numeric_scope 09-19 13:11:58.147 311 18128 D resolv : android_getaddrinfofornetcontext: explore_numeric: ai_family=2 ai_socktype=1 ai_protocol=6
@olexanderPotebenko olexanderPotebenko changed the title Detox can't seem to connect to the test app(s)! Android. Detox can't seem to connect to the test app(s)! Sep 18, 2022
@github-actions
Copy link

This issue appears to be a general usage or support question.
In order to get help, please either ask a question on Stack Overflow with the detox tag, or simply join our Discord.
Feel free to post your Stack Overflow question here for more visibility! We'll take a look at it ASAP.
For more information about our policy on issues, refer to this discussion.

@d4vidi
Copy link
Collaborator

d4vidi commented Sep 20, 2022

Tip: Try launching the app from within a test rather than the beforeAll(). Also, track you device logs in order to look up potential app crashes.

@olexanderPotebenko
Copy link
Author

olexanderPotebenko commented Sep 20, 2022

@d4vidi Thanks for the answer. I added it like this:

Code
it('should have welcome screen', async () => {
await device.launchApp();
await expect(element(by.id('welcome'))).toBeVisible();
});

It gives exactly the same result. I think the problem of not passing the tests is that detox cannot connect to the emulator. This can be seen from the output of the command adb logcat:

No valid NAT64 prefix (112, /0) 09-19 13:11:49.109 17404 18119 D DetoxWSClient: Retrying...

as well as in the detox logs:

TRACE: [WSS_SEND_TO, #tester] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants