Open tarikfp opened 1 year ago
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
,
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
Why aren't the debug-sync logs shown - I wonder? Would have made what the problem is very clear.
@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,
I meant in the terminal. If they're in debug, would make sense to bump their log-level to info. WDYT?
I meant in the terminal. If they're in debug, would make sense to bump their log-level to info. WDYT?
Strikes me odd: https://github.com/wix/Detox/blob/6145653d0077d5e406a48e539c3a3ea2f7d968bb/detox/src/client/Client.js#L265
Might have been an error that's triggered the debug
"fallback" log instead, or - @tarikpnr have you by any chance actively disabled syncrhonization debugging?
@d4vidi The synchronization was enabled. The OP mostly likely did not notice .
@d4vidi @noomorph After your feedbacks regarding the issue, I've decided to take another shot:
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 />;
}
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();
});
});
ios.sim.debug.2023-02-23 18-07-38Z.zip
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,
@tarikpnr thanks for taking the extra-mile, it will definitely prove helpful.
@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.
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.
@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 ?
It will not work in new architecture (when you see fabric: true
in metro console) (still need confirmation)
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:true
option.
Double-checked through the metro console, notice below there is no fabric: true
option. And it did run the tests properly when I tried.
In contrast, fabric option was enabled in the initial video that I shared. See below:
I assume it initializes project with fabric
by default using ,npx react-native@latest init AwesomeProject
command. 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.
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.
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.
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.
The app has not responded to the network requests below:
(id = -1000) isReady: {}
Unresponded network requests might result in timeout errors in Detox tests.
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.
Not stale, facing the same issue.
I am also facing the same issue on native-ios app
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.
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.
is there any workaround for this ?
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?
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.
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.
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.
following here for turbo module support
Following for turbo
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.
Still happening on latest. Remarking this as not stale.
still seems to be an issue. following for turbo module support.
Looks like same issue as here: https://github.com/wix/Detox/issues/4506 Up for New Architecture support
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:
What was the expected behaviour?
It should not get stuck, and process the test cases.
Was it tested on latest Detox?
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-testingIn 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.https://user-images.githubusercontent.com/61876765/220784475-33760b13-a43e-4bc0-89b0-3b2bbba72c5a.mp4