wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.25k stars 1.92k forks source link

Detox server connection fails #678

Closed vignesarul closed 6 years ago

vignesarul commented 6 years ago

Description

Test execution stops at connectToServer - retrying... loop (check adb logs).

Version

ADB log

D/ReactNative( 1740): [CodePush] Loading JS bundle from "assets://index.android.bundle"
D/ReactNative( 1740): ReactInstanceManager.ctor()
I/Choreographer(  851): Skipped 36 frames!  The application may be doing too much work on its main thread.
I/Choreographer(  851): Skipped 34 frames!  The application may be doing too much work on its main thread.
D/ReactNative( 1740): ReactInstanceManager.createReactContextInBackground()
D/ReactNative( 1740): ReactInstanceManager.recreateReactContextInBackgroundInner()
I/Choreographer(  404): Skipped 55 frames!  The application may be doing too much work on its main thread.
D/LifecycleMonitor( 1740): Lifecycle status change: com.myappcart.MainActivity@39bed498 in: CREATED
D/LifecycleMonitor( 1740): Lifecycle status change: com.myappcart.MainActivity@39bed498 in: STARTED
D/LifecycleMonitor( 1740): Lifecycle status change: com.myappcart.MainActivity@39bed498 in: RESUMED
V/WindowManager(  404): Adding window Window{8cbe8e8 u0 com.myappcart/com.myappcart.MainActivity} at 3 of 7 (before Window{30671af6 u0 Starting com.myappcart})
D/gralloc_goldfish( 1740): Emulator without host-side GPU emulation detected.
I/ActivityManager(  404): Displayed com.myappcart/.MainActivity: +1s806ms
I/Choreographer(  404): Skipped 34 frames!  The application may be doing too much work on its main thread.
W/art     (  404): Long monitor contention event with owner method=void com.android.server.wm.WindowAnimator$1.run() from WindowAnimator.java:124 waiters=0 for 140ms
I/Choreographer(  404): Skipped 33 frames!  The application may be doing too much work on its main thread.
W/unknown:InspectorPackagerConnection( 1740): Couldn't connect to packager, will silently retry
W/art     (  404): Long monitor contention event with owner method=int com.android.server.wm.WindowManagerService.relayoutWindow(com.android.server.wm.Session, android.view.IWindow, int, android.view.WindowManager$LayoutParams, int, int, int, int, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.content.res.Configuration, android.view.Surface) from WindowManagerService.java:3012 waiters=0 for 218ms
I/DetoxManager( 1740): DetoxServerUrl : ws://localhost:35797
I/DetoxManager( 1740): DetoxSessionId : a926764a-3f2d-8532-b70a-4acce439d9ab
D/ReactNative( 1740): ReactInstanceManager.onJSBundleLoadedFromServer()
D/ReactNative( 1740): ReactInstanceManager.recreateReactContextInBackground()
D/ReactNative( 1740): ReactInstanceManager.runCreateReactContextOnNewThread()
I/art     ( 1740): Thread[24,tid=1771,WaitingForJniOnLoad,Thread*=0xb4ae1400,peer=0x12c0b340,"Thread-173"] recursive attempt to load library "/data/app/com.myappcart-1/lib/arm/libfb.so"
D/ReactNative( 1740): ReactInstanceManager.createReactContext()
I/art     ( 1740): Background partial concurrent mark sweep GC freed 16861(1099KB) AllocSpace objects, 0(0B) LOS objects, 40% free, 3MB/6MB, paused 4.305ms total 297.343ms
E/Vold    (   53): Failed to find mounted volume for /storage/sdcard/Android/data/com.myappcart/cache/
W/Vold    (   53): Returning OperationFailed - no handler for errno 0
W/ContextImpl( 1740): Failed to ensure directory: /storage/sdcard/Android/data/com.myappcart/cache
D/ReactNative( 1740): Initializing React Xplat Bridge.
D/ReactNative( 1740): Initializing React Xplat Bridge before initializeBridge
D/ReactNative( 1740): Initializing React Xplat Bridge after initializeBridge
D/ReactNative( 1740): CatalystInstanceImpl.runJSBundle()
D/ReactNative( 1740): ReactInstanceManager.setupReactContext()
D/ReactNative( 1740): CatalystInstanceImpl.initialize()
W/unknown:ReactNative( 1740): Packager connection already open, nooping.
D/ReactNative( 1740): ReactInstanceManager.attachRootViewToInstance()
D/Detox   ( 1740): Got reactContext directly
I/Detox   ( 1740): Removing Espresso IdlingResources for React Native.
I/Detox   ( 1740): Setting up Espresso Idling Resources for React Native.
I/Detox   ( 1740): Got react context through listener.
I/WebViewFactory( 1740): Loading com.android.webview version 39 (3079158-arm) (code 300001)
I/LibraryLoader( 1740): Time to load native libraries: 191 ms (timestamps 8542-8733)
I/LibraryLoader( 1740): Expected native library version number "",actual native library version number ""
W/art     ( 1740): Attempt to remove local handle scope entry from IRT, ignoring
I/Detox   ( 1740): mqt_js looper is busy
I/Choreographer( 1740): Skipped 2833 frames!  The application may be doing too much work on its main thread.
I/ReactNativeJS( 1740): Running application "myappcart" with appParams: {"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
I/Detox   ( 1740): mqt_native_modules looper is busy
I/WebSocketClient( 1740): At connectToServer
I/ReactNativeJS( 1740): [CodePush] Sync already in progress.
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
I/ReactNativeJS( 1740): [CodePush] Checking for update.
I/ReactNativeJS( 1740): [CodePush] Reporting binary update (1.0)
I/art     ( 1740): Background sticky concurrent mark sweep GC freed 22556(1134KB) AllocSpace objects, 4(64KB) LOS objects, 23% free, 4MB/6MB, paused 4.008ms total 242.527ms
I/ReactNativeJS( 1740): [CodePush] An unknown error occurred.
I/ReactNativeJS( 1740): [CodePush] 400: An update check must include a valid deployment key - please check that your app has been configured correctly. To view available deployment keys, run 'code-push deployment ls <appName> -k'.
I/ReactNativeJS( 1740): [CodePush] Report status failed: {"appVersion":"1.0"}
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
I/art     ( 1740): Background partial concurrent mark sweep GC freed 2344(161KB) AllocSpace objects, 0(0B) LOS objects, 32% free, 8MB/12MB, paused 2.389ms total 146.657ms
I/Choreographer( 1740): Skipped 52 frames!  The application may be doing too much work on its main thread.
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
I/Choreographer( 1740): Skipped 34 frames!  The application may be doing too much work on its main thread.
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
D/WebSocketClient( 1740): Retrying...
I/WebSocketClient( 1740): At connectToServer
D/WebSocketClient( 1740): Retrying...

Detox logs

detox verb 10: stdout: [ 91%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 95%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 98%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [100%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: /home/travis/build/myappcart/myappcart-app/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk: 1 file pushed. 4.4 MB/s (1998541 bytes in 0.438s)
detox verb 10: stdout:  pkg: /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: Success
detox verb 10: stdout: 
detox verb 11: /usr/local/android-sdk/platform-tools/adb -s emulator-5554 shell am force-stop com.myappcartnative 
detox verb /usr/local/android-sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:42868 -e detoxSessionId 6a06352e-fc05-53d2-43c9-feefdc9100ef -e debug false com.myappcartnative.test/android.support.test.runner.AndroidJUnitRunner 
detox verb Instrumentation spawned, childProcess.pid:  24273
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.myappcartnative.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.myappcartnative.DetoxTest
detox verb Instrumentation stdout:  INSTRUMENTATION_STATUS: current=1
detox verb Instrumentation stdout:  INSTRUMENTATION_STATUS_CODE: 1
detox verb Instrumentation stdout:  
Bundling `index.js`  [development, non-minified]  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  100.0% (1072/1072)

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated
vignesarul commented 6 years ago

Hi @LeoNatan Your inputs will be very much helpful.

LeoNatan commented 6 years ago

Sorry, I am not the right person for Android input :) @rotemmiz

rotemmiz commented 6 years ago

When the test runner stops, the device will continue retrying to connect to it (this is by design, though not sure if we still need it).

Anyway, your error comes from code push, not sure it's related to Detox.

I/ReactNativeJS( 1722): [CodePush] An unknown error occurred.
I/ReactNativeJS( 1722): [CodePush] 400: An update check must include a valid deployment key - please check that your app has been configured correctly. To view available deployment keys, run 'code-push deployment ls <appName> -k'.
stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

stale[bot] commented 6 years ago

The issue has been closed for inactivity.