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

[RN-0.71 - iOS] The app has not responded to the network requests below: (id = -1000) isReady: {} #3949

Open
2 tasks done
tarikfp opened this issue Feb 22, 2023 · 33 comments
Open
2 tasks done

Comments

@tarikfp
Copy link

tarikfp commented Feb 22, 2023

What happened?

When running debug test script after a successful build, the app launches, then it gets stuck infinitely.
(Note: Android is working fine, its only for iOS)

After timeout, it throws the following error:

image

What was the expected behaviour?

It should not get stuck, and process the test cases.

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!

Simple react-native app, issue is reproducible in main branch
https://github.com/tarikpnr/react-native-testing

In what environment did this happen?

Detox version: 20.1.3
React Native version: 0.71.2
Has Fabric (React Native's new rendering system) enabled: yes
Node version: v16.19.1
Device model: iPhone 12
iOS version: 16.2
Xcode version: 14.2
Test-runner (select one): jest

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste logs here!

More data, please!

Demonstration video (4x), starting from running yarn run detox test --configuration ios.sim.debug script.

detox-ios-test-stuck.mp4
@tarikfp
Copy link
Author

tarikfp commented Feb 22, 2023

I will share the artifacts below, since I was not able to put logs due to the following restriction from github: There was an error posting your comment: Body is too long,

artifacts.zip

@noomorph
Copy link
Collaborator

Looks like there are some stuck/pending network requests in your app:

{"params":{"status":{"app_status":"busy","busy_resources":[{"name":"dispatch_queue","description":{"queue":"Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)","works_count":1}},{"name":"one_time_events","description":{"event":"Network Request","object":"URL: “https://fakestoreapi.com/img/61pHAEJ4NML._AC_UX679_.jpg”"}},{"name":"one_time_events","description":{"event":"Network Request","object":"URL: “https://fakestoreapi.com/img/71HblAHs5xL._AC_UY879_-2.jpg”"}},{"name":"one_time_events","description":{"event":"Network Request","object":"URL: “https://fakestoreapi.com/img/61mtL65D4cL._AC_SX679_.jpg”"}},{"name":"run_loop","description":{"name":"Main Run Loop"}},{"name":"one_time_events","description":{"event":"Network Request","object":"URL: “https://fakestoreapi.com/img/51eg55uWmdL._AC_UX679_.jpg”"}},{"name":"one_time_events","description":{"event":"React Native (bundle load)","object":null}}]},"messageId":1},"messageId":1,"type":"currentStatusResult"}

e.g. https://fakestoreapi.com/img/61pHAEJ4NML._AC_UX679_.jpg – they are never ending or something like that

@d4vidi
Copy link
Collaborator

d4vidi commented Feb 23, 2023

Why aren't the debug-sync logs shown - I wonder? Would have made what the problem is very clear.

@noomorph
Copy link
Collaborator

noomorph commented Feb 23, 2023

@d4vidi , the OP wrote why:

I will share the artifacts below, since I was not able to put logs due to the following restriction from github: There was an error posting your comment: Body is too long,

@d4vidi
Copy link
Collaborator

d4vidi commented Feb 23, 2023

I meant in the terminal. If they're in debug, would make sense to bump their log-level to info. WDYT?

@d4vidi
Copy link
Collaborator

d4vidi commented Feb 23, 2023

I meant in the terminal. If they're in debug, would make sense to bump their log-level to info. WDYT?

Strikes me odd:

log.info({ event: 'APP_STATUS' }, status);

Might have been an error that's triggered the debug "fallback" log instead, or - @tarikpnr have you by any chance actively disabled syncrhonization debugging?

@noomorph
Copy link
Collaborator

@d4vidi The synchronization was enabled. The OP mostly likely did not notice .

image

@tarikfp
Copy link
Author

tarikfp commented Feb 23, 2023

@d4vidi @noomorph After your feedbacks regarding the issue, I've decided to take another shot:

  • The app is even simpler now, no any 3rd party call.

import React from 'react';
import {Button, Text, View} from 'react-native';
import {COMMON_STYLES} from './theme/common-styles';

const Counter = () => {
  const [counter, setCounter] = React.useState(0);

  return (
    <View style={COMMON_STYLES.flexCenter}>
      <Button
        testID="increase-btn"
        onPress={() => setCounter(prev => prev + 1)}
        title="Increase"
      />
      <Button
        testID="decrease-btn"
        onPress={() => setCounter(prev => prev - 1)}
        title="Decrease"
      />
      <Text testID="count-text">Count: {counter}</Text>
    </View>
  );
};

export default function App() {
  return <Counter />;
}
  • Corresponding e2e test file

describe('Example', () => {
  beforeAll(async () => {
    await device.launchApp({
      newInstance: true,
    });
  });

  beforeEach(async () => {
    await device.reloadReactNative();
  });

  test('complete app flow', async () => {
    await element(by.id('increase-btn')).tap();
  });
});
  • Demonstration

detox-ios-debug-e2e-4x.mp4
  • Artifacts file

ios.sim.debug.2023-02-23 18-07-38Z.zip

  • Reproducible source code

Created a new branch called test/ios-e2e-debug.
https://github.com/tarikpnr/react-native-testing/tree/test/ios-e2e-debug


Unfortunately, it throws the same error, from what I can see it gets busy with event "React Native (bundle load)":

  data: {
    "params": {
      "status": {
        "busy_resources": [
          {
            "name": "one_time_events",
            "description": {
              "event": "React Native (bundle load)",
              "object": null
            }
          },
          {
            "name": "run_loop",
            "description": {
              "name": "Main Run Loop"
            }
          },
          {
            "name": "dispatch_queue",
            "description": {
              "queue": "Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)",
              "works_count": 1
            }
          }
        ],
        "app_status": "busy"
      },
      "messageId": 1
    },
    "messageId": 1,

@d4vidi
Copy link
Collaborator

d4vidi commented Feb 23, 2023

@tarikpnr thanks for taking the extra-mile, it will definitely prove helpful.

@d4vidi
Copy link
Collaborator

d4vidi commented Feb 23, 2023

@tarikpnr I've put in a serious effort, trying to run thereact-native-testing project on iOS. I've managed to overcome some issues (ruby + pod installations). Eventually stopped at getting this from metro when bundling the app:

error: ReferenceError: SHA-1 for file /Users/<omitted>nvm/versions/node/v14.18.2/lib/node_modules/react-native/node_modules/metro-runtime/src/polyfills/require.js (/Users/<omitted>nvm/versions/node/v14.18.2/lib/node_modules/react-native/node_modules/metro-runtime/src/polyfills/require.js) is not computed.
         Potential causes:
           1) You have symlinks in your project - watchman does not follow symlinks.
           2) Check `blockList` in your metro.config.js and make sure it isn't excluding the file path.

Anyways would you be able to try running that project with RN .70 instead of .71? I think the problem might lie there.

@d4vidi
Copy link
Collaborator

d4vidi commented Feb 23, 2023

Update: I've managed to get passed that. Bottom line is that while the images download sure is on the slow side, the test ultimately passes (i.e. your problem does not reproduce). I think you might like to try to increase the timeout (120000ms may not be enough), on account of the download's slowness.

@tarikfp
Copy link
Author

tarikfp commented Feb 23, 2023

@d4vidi Thanks for your efforts. I have actually updated the repo by creating the new branch, as I also mentioned here you probably tested it on main branch which has third party API call. It'd be perfect if you switch to the branch called as ios-e2e-debug and test it from there. (Not sure tho, might not necessarily needed since you already managed to run it in main. But just curious to see if it is running on that branch too, as I was not able to run the test in a simple counter app, and we would make sure to determine whether its related to download's slowness or not by doing this way.)

And, have you done any changes to the repo to make it run? If not, then I doubt it is maybe sort of environment issue ?

@tarikfp
Copy link
Author

tarikfp commented Feb 24, 2023

TL&DR

It will not work in new architecture (when you see fabric: true in metro console) (still need confirmation)


Attempts

I ended up resetting everything related to iOS using react-native-clean-project, and having this new Podfile.lock seems to fix the issue.

Considering react-native-clean-project using the typical pod install but not bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install which means it will end up setting up an environment without fabric or in other words, new architecture is NOT enabled.

According to docs, determining whether the new architecture is in use or not is simply checking fabric:trueoption.

Double-checked through the metro console, notice below there is no fabric: true option. And it did run the tests properly when I tried.

image

In contrast, fabric option was enabled in the initial video that I shared. See below:

image

I assume it initializes project with fabric by default using ,npx react-native@latest init AwesomeProjectcommand. Then, in the very next pod install it does revert fabric. If you want to keep fabric in the project, The default pod-install script should be the following as the docs suggest:

"scripts": {
  "pod-install": "RCT_NEW_ARCH_ENABLED=1 bundle exec pod install"
}

@d4vidi Most probably it was the case for you as well, there is a high chance that you may have initialized the project without fabric, therefore you were not able to reproduce the error I faced, just guessing at the moment, that's the reason it still needs confirmation.

@stale
Copy link

stale bot commented Apr 12, 2023

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.

@stale stale bot added the 🏚 stale label Apr 12, 2023
@sgabriel
Copy link

I'm facing the same issue, that all tests won't start when using fabric. They time out with this error

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

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

@stale
Copy link

stale bot commented May 20, 2023

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.

@stale stale bot added the 🏚 stale label May 20, 2023
@Numan-Munir
Copy link

Numan-Munir commented Jun 8, 2023

I'm facing the same issue, that all tests won't start when using fabric. They time out with this error

The app has not responded to the network requests below:

(id = -1000) isReady: {}

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

Screenshot 2023-06-08 at 12 48 57 PM

@stale stale bot removed the 🏚 stale label Jun 8, 2023
@stale
Copy link

stale bot commented Jul 15, 2023

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.

@stale stale bot added the 🏚 stale label Jul 15, 2023
@badsyntax
Copy link
Contributor

Not stale, facing the same issue.

@stale stale bot removed the 🏚 stale label Jul 20, 2023
@sam060584
Copy link

I am also facing the same issue on native-ios app

@Numan-Munir
Copy link

I am also facing the same issue on native-ios app

My issue has been resolved. I was using the "import * as Progress from "react-native-progress";" library to implement a progress bar. However, I have now commented it out.

@stale
Copy link

stale bot commented Sep 16, 2023

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.

@stale stale bot added the 🏚 stale label Sep 16, 2023
@nmongiya
Copy link

is there any workaround for this ?

@timmyjose
Copy link

I'm seeing the exact same issue with a React Native prototype (Turbo Modules (C++), New Architecture). Triggering the tests via eas build:

[ON_BUILD_SUCCESS_HOOK] 17:04:29.459 detox[43533] i The app has not responded to the network requests below:
[ON_BUILD_SUCCESS_HOOK]   (id = -1000) isReady: {}

Can we have an official word on whether this the New Architecture is supported/not supported/it's some other issue?

@stale stale bot removed the 🏚 stale label Jan 19, 2024
@asafkorem
Copy link
Contributor

I'm seeing the exact same issue with a React Native prototype (Turbo Modules (C++), New Architecture). Triggering the tests via eas build:

[ON_BUILD_SUCCESS_HOOK] 17:04:29.459 detox[43533] i The app has not responded to the network requests below:
[ON_BUILD_SUCCESS_HOOK]   (id = -1000) isReady: {}

Can we have an official word on whether this the New Architecture is supported/not supported/it's some other issue?

Hey @timmyjose, we do not support turbo modules ATM however we're aiming to support that soon. No official ETA unfortunately.

@asafkorem
Copy link
Contributor

is there any workaround for this ?

Hey @nmongiya, can you please elaborate what issue are you facing (provide logs or any information that might be useful)?
The error on the issue title is quite general and might indicate on a different issue than yours.

@timmyjose
Copy link

timmyjose commented Jan 23, 2024

Hey @asafkorem, thank you for confirming that. 🙏 It's a bit unfortunate, but at least now we know that it's not an issue in our setup! We're now looking into using the Old Architecture (non Turbo Modules) in the meantime, and when support for Turbo Modules is available (hopefully soon!), we'll probably migrate back.

@skylarbarrera
Copy link

following here for turbo module support

@walmat
Copy link

walmat commented Jan 26, 2024

Following for turbo

Copy link

stale bot commented Mar 17, 2024

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.

@stale stale bot added the 🏚 stale label Mar 17, 2024
@walmat
Copy link

walmat commented Mar 17, 2024

Still happening on latest. Remarking this as not stale.

@stale stale bot removed the 🏚 stale label Mar 17, 2024
@BrodyHughes
Copy link

still seems to be an issue. following for turbo module support.

@Sky
Copy link

Sky commented Oct 22, 2024

Looks like same issue as here: #4506
Up for New Architecture support

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