wix / Detox

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

The app has not responded to the network requests below: (id = 1) currentStatus: {} (id = -1000) isReady: {} #4151

Open sonujangra-mw opened 1 year ago

sonujangra-mw commented 1 year ago

What happened?

image

Emulator: Pixel_6_API_33 RN Version: ^0.72.3 Detox Version: ^20.7.0

12:36:47.716 detox[12900] i ws-client:PENDING_REQUESTS The app has not responded to the network requests below: (id = 1) currentStatus: {} (id = -1000) isReady: {}

Unresponded network requests might result in timeout errors in Detox tests.

12:36:52.719 detox[12900] i ws-client:ERROR The pending request #-49642 ("cleanup") has been rejected due to the following error:

The tester has not received a response within 5000ms timeout to the message:

Cleanup { type: 'cleanup', params: [Object], messageId: -49642 }

What was the expected behaviour?

Unable to run detox test for android.

Was it tested on latest Detox?

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: ^20.7.0 React Native version: ^0.72.3 Has Fabric (React Native's new rendering system) enabled: (yes/no) no Node version: v18.15.0 Device model: Pixel_6_API_33 Android version: 13 Test-runner (select one): jest / other jest

Detox logs

Detox logs ``` 12:33:43.583 detox[12897] i ws-server Detox server listening on localhost:56684... 12:33:43.593 detox[12897] B lifecycle jest --config e2e/jest.config.js 12:33:45.017 detox[12900] i jest-circus@29.6.2 does not match jest@29.5.0. - jest@29.5.0 resolved path: /Users/cookcounty/projects/cch-mobile-app/node_modules/jest/package.json - jest-circus@29.6.2 resolved path: /Users/cookcounty/.nvm/versions/node/v18.15.0/lib/node_modules/jest/node_modules/jest-circus/package.json Please make sure that your versions match to avoid unexpected behavior! 12:33:45.511 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/emulator/emulator" -list-avds --verbose 12:33:45.589 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/emulator/emulator" -version 12:33:46.962 detox[12900] i device Detected emulator binary version { major: 32, minor: 1, patch: 14, toString: [Function: toString] } 12:33:46.963 detox[12900] i device:ALLOCATE_DEVICE Trying to allocate a device based on "Pixel_6_API_33" 12:33:46.965 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" devices 12:33:47.176 detox[12900] i child-process:EXEC_SUCCESS List of devices attached emulator-5554 device 12:33:47.189 detox[12900] i device:DEVICE_LOOKUP Found a matching & free device emulator-5554 12:33:47.191 detox[12900] i device:ALLOCATE_DEVICE Settled on emulator-5554 12:33:47.192 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop dev.bootcomplete" 12:33:47.391 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop ro.build.version.sdk" 12:33:47.494 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global animator_duration_scale 0" 12:33:47.893 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global window_animation_scale 0" 12:33:48.683 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global transition_animation_scale 0" 12:33:48.885 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "dumpsys power | grep \"^[ ]*m[UW].*=\"" 12:33:49.940 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/build-tools/34.0.0/aapt" dump badging "/Users/cookcounty/projects/cch-mobile-app/android/app/build/outputs/apk/debug/app-debug.apk" 12:33:50.052 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list packages org.cookcountyhealth.connected" 12:33:50.394 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 uninstall org.cookcountyhealth.connected 12:33:53.388 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list packages org.cookcountyhealth.connected.test" 12:33:53.842 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 uninstall org.cookcountyhealth.connected.test 12:33:55.590 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop org.cookcountyhealth.connected" 12:33:57.394 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/build-tools/34.0.0/aapt" dump xmlstrings "/Users/cookcounty/projects/cch-mobile-app/android/app/build/outputs/apk/debug/app-debug.apk" AndroidManifest.xml 12:33:57.415 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/build-tools/34.0.0/aapt" dump xmlstrings "/Users/cookcounty/projects/cch-mobile-app/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk" AndroidManifest.xml 12:33:57.440 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "rm -fr /data/local/tmp/detox" 12:33:57.791 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "mkdir -p /data/local/tmp/detox" 12:33:58.891 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 push "/Users/cookcounty/projects/cch-mobile-app/android/app/build/outputs/apk/debug/app-debug.apk" "/data/local/tmp/detox/Application.apk" 12:34:21.242 detox[12900] i child-process:SPAWN_CMD /Users/cookcounty/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk 12:34:45.694 detox[12900] i child-process:SPAWN_END /Users/cookcounty/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk exited with code #0 12:34:45.695 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 push "/Users/cookcounty/projects/cch-mobile-app/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk" "/data/local/tmp/detox/Test.apk" 12:34:45.854 detox[12900] i child-process:SPAWN_CMD /Users/cookcounty/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Test.apk 12:34:46.759 detox[12900] i child-process:SPAWN_END /Users/cookcounty/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Test.apk exited with code #0 12:34:46.760 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse tcp:8082 tcp:8082 12:34:46.799 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop org.cookcountyhealth.connected" 12:34:47.660 detox[12900] i lifecycle starter.test.js is assigned to emulator-5554 (Pixel_6_API_33) 12:34:47.672 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop org.cookcountyhealth.connected" 12:34:47.743 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "date +\"%m-%d %T.000\"" 12:34:47.820 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse tcp:56684 tcp:56684 12:34:47.861 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list instrumentation" 12:34:47.933 detox[12900] i child-process:SPAWN_CMD /Users/cookcounty/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:56684 -e detoxSessionId 096cb7fe-2924-3e7d-35e8-19a87b21f84c -e debug false org.cookcountyhealth.connected.test/androidx.test.runner.AndroidJUnitRunner 12:34:48.434 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"org\.cookcountyhealth\.connected$\"" 12:35:06.445 detox[12900] i ws-client:APP_STATUS Failed to execute the current status query. 12:36:47.666 detox[12900] i lifecycle Example: should have welcome screen 12:36:47.669 detox[12900] i lifecycle Example: should have welcome screen [FAIL] 12:36:47.675 detox[12900] i lifecycle Example: should show hello screen after tap 12:36:47.676 detox[12900] i lifecycle Example: should show hello screen after tap [FAIL] 12:36:47.677 detox[12900] i lifecycle Example: should show world screen after tap 12:36:47.677 detox[12900] i lifecycle Example: should show world screen after tap [FAIL] 12:36:47.716 detox[12900] i ws-client:PENDING_REQUESTS The app has not responded to the network requests below: (id = 1) currentStatus: {} (id = -1000) isReady: {} Unresponded network requests might result in timeout errors in Detox tests. 12:36:52.719 detox[12900] i ws-client:ERROR The pending request #-49642 ("cleanup") has been rejected due to the following error: The tester has not received a response within 5000ms timeout to the message: Cleanup { type: 'cleanup', params: [Object], messageId: -49642 } 12:36:52.726 detox[12900] i child-process:SPAWN_END /Users/cookcounty/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:56684 -e detoxSessionId 096cb7fe-2924-3e7d-35e8-19a87b21f84c -e debug false org.cookcountyhealth.connected.test/androidx.test.runner.AndroidJUnitRunner terminated with SIGINT 12:36:52.727 detox[12900] i device An error occurred while waiting for the app to become ready. Waiting for disconnection... error: Failed to run application on the device HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process. 12:36:52.727 detox[12900] i child-process:EXEC_CMD "/Users/cookcounty/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse --remove tcp:56684 FAIL e2e/starter.test.js (182.645 s) Example ✕ should have welcome screen (3 ms) ✕ should show hello screen after tap (1 ms) ✕ should show world screen after tap (1 ms) ● Example › should have welcome screen thrown: "Exceeded timeout of 120000 ms for a hook. Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout." 2 | 3 | describe('Example', () => { > 4 | beforeAll(async () => { | ^ 5 | //await device.launchApp(); 6 | 7 | await device.launchApp({ newInstance: true }); at beforeAll (e2e/starter.test.js:4:3) at Object.describe (e2e/starter.test.js:3:1) ● Example › should show hello screen after tap thrown: "Exceeded timeout of 120000 ms for a hook. Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout." 2 | 3 | describe('Example', () => { > 4 | beforeAll(async () => { | ^ 5 | //await device.launchApp(); 6 | 7 | await device.launchApp({ newInstance: true }); at beforeAll (e2e/starter.test.js:4:3) at Object.describe (e2e/starter.test.js:3:1) ● Example › should show world screen after tap thrown: "Exceeded timeout of 120000 ms for a hook. Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout." 2 | 3 | describe('Example', () => { > 4 | beforeAll(async () => { | ^ 5 | //await device.launchApp(); 6 | 7 | await device.launchApp({ newInstance: true }); at beforeAll (e2e/starter.test.js:4:3) at Object.describe (e2e/starter.test.js:3:1) 12:36:52.861 detox[12897] E lifecycle Command failed with exit code = 1: jest --config e2e/jest.config.js 12:36:52.863 detox[12897] i ws-server Detox server has been closed gracefully 12:36:52.864 detox[12897] E ws-server connection :56684<->:57112 ```

Device logs

Device logs ``` 08-01 13:11:22.967 9196 9783 D DetoxWSClient: Retrying... 08-01 13:11:22.967 9196 9783 I DetoxWSClient: At connectToServer 08-01 13:11:22.972 31923 9786 I resolv : GetAddrInfoHandler::run: {101 101 101 983141 10204 0} 08-01 13:11:22.973 9196 9785 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:24.592 9196 9476 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:24.593 9196 9477 D TrafficStats: tagSocket(153) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:26.165 31986 31986 W Looper : Slow delivery took 259ms main h=android.os.Handler c=com.android.internal.os.BinderCallsStats$1@82cae02 m=0 08-01 13:11:26.167 9196 9785 D DetoxWSClient: Retrying... 08-01 13:11:26.168 9196 9785 I DetoxWSClient: At connectToServer 08-01 13:11:26.175 31923 9790 I resolv : GetAddrInfoHandler::run: {101 101 101 983141 10204 0} 08-01 13:11:26.176 9196 9789 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:26.190 31986 32156 D androidtc: Initializing SystemTextClassifier, type = System 08-01 13:11:26.197 32175 32175 I ClipboardListener: Clipboard overlay suppressed. 08-01 13:11:26.254 32175 32175 I ClipboardListener: Clipboard overlay suppressed. 08-01 13:11:26.643 9196 9476 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:26.648 9196 9477 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:28.657 9196 9476 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:28.668 9196 9477 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:29.182 9196 9789 D DetoxWSClient: Retrying... 08-01 13:11:29.182 9196 9789 I DetoxWSClient: At connectToServer 08-01 13:11:29.191 31923 9795 I resolv : GetAddrInfoHandler::run: {101 101 101 983141 10204 0} 08-01 13:11:29.192 9196 9794 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:30.669 9196 9476 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:30.675 9196 9477 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:31.164 31986 31986 W Looper : Drained 08-01 13:11:32.196 9196 9794 D DetoxWSClient: Retrying... 08-01 13:11:32.196 9196 9794 I DetoxWSClient: At connectToServer 08-01 13:11:32.200 31923 9801 I resolv : GetAddrInfoHandler::run: {101 101 101 983141 10204 0} 08-01 13:11:32.200 9196 9800 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:32.678 9196 9476 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:32.684 9196 9477 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:34.688 9196 9476 D TrafficStats: tagSocket(123) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:34.694 9196 9477 D TrafficStats: tagSocket(153) with statsTag=0xffffffff, statsUid=-1 08-01 13:11:35.204 9196 9800 D DetoxWSClient: Retrying... ```

More data, please!

No response

eilinwis commented 12 months ago

i guess you're receiving this error due the incompatibility detox 20.7 and react-native 0.72 but i believe that work is in progress

MarcelinaZiolkiewicz commented 10 months ago

Same issue here but i have different versions: Detox version: ^20.13.2 React Native version: ^0.72.6 Did you find any solution?

noomorph commented 10 months ago

Well, you can try to launch the app this way (emergency launch), but that's a dead end. It's hard to know what's not idle there. 🤷‍♂️

  beforeEach(async () => {
    await device.launchApp({
+     launchArgs: { detoxEnableSynchronization: 0 },
      newInstance: true
    });
  });
stale[bot] commented 8 months 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!

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

tamaniniandre commented 7 months ago

it happened to me today

stale[bot] commented 5 months 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!

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

joesardo commented 1 month ago

This issue is not stale - I consistently see some form of this on our CICD platform where the test is saying it has not received a network request, usually in the form of: detox[37716] i The app has not responded to the network requests below: (id = 6) invoke: {"type":"action","action":"tap","predicate":{"type":"id","value":"bellsant:Signin","isRegex":false}} (id = 7) currentStatus: {}

Very annoying to debug as the element is clearly on the screen and has zero issues running locally. Please look into this 🙏

maxmilianf commented 1 month ago

Same here with:

    "detox": "^20.23.1",
     "react-native": "0.74.3",