Open owens-ben opened 1 year ago
Bump?
It seems like the issue may relate to some kind of 45000 ms timeout in the code.
I see this in node_modules/detox/src/devices/common/drivers/android/exec/ADB.js:
const INSTALL_TIMEOUT = 45000; // TODO Double check 45s makes sense
So it seems like there was some debate about whether this is right.
I used patch-package to change this to 300000 and it still times out, claiming the 45000 timeout!!
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 see this in node_modules/detox/src/devices/common/drivers/android/exec/ADB.js: const INSTALL_TIMEOUT = 45000; // TODO Double check 45s makes sense So it seems like there was some debate about whether this is right. I used patch-package to change this to 300000 and it still times out, claiming the 45000 timeout!!
The installation appears to be successful, so this timeout is irrelevant. You might be able to extend it via a native Detox config but I think 45seconds is way more than enough.
Important question: Does this usuually work on your local computer?
In any case, you might like to review device (native) logs (i.e. using adb logcat
) in order to look up an error that might have crashed your app or something along those lines.
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.
@d4vidi yes, it works locally. Since then I was able to configure it to run with iOS on an M1 machine. I will be returning to this issue shortly as we still have the need for Android tests.
Here's what I tried to debug:
sshing into the bitrise machine and running the command manually - same result
I was able to dump the logcat logs but its so long and full of errors that may or may not be relevant. please advise how to proceed.
Consider installing pidcat
on the bitrise machine and then - instead of adb logcat
, run pidcat <package name>
. This should help cut through the irrelevant noise in the log.
Alternatively, use detox test <...> --record-logs all
and dig up the device.log
file from artifacts
once the run is completed.
@d4vidi thanks for the advice.
I was able to get the full device log, if you want to take a look.
I see lots of errors so not sure which one might actually be making the app hang, perhaps this one?
07-06 15:32:27.342 6354 6499 I AppLinksHostsVerifierV2: Verification com.myorg.app.qa complete. Successful hosts: links-qa.myotherorg.com,qa-web.myotherorg.com. Failed hosts: *.myotherorg.com. Error hosts: . [CONTEXT service_id=244 ]
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 issue has been closed for inactivity.
Still an issue.
Still an issue. I revisited this and tried a couple suggestions from around the internet.
I tried starting the Metro bundler in a separate command yarn start & (this seemed to solve other issues). I also stopped and started the adb server before initiating the tests.
I'm now seeing this generic JS looper error being output.
20:50:41.839 detox[7027] i ws-server@55587 send
data: {
"type": "currentStatus",
"params": {},
"messageId": 1
}
20:50:46.839 detox[7053] i ws-client:APP_STATUS Failed to execute the current status query.
BUNDLE ./index.js
20:51:38.143 detox[7027] i ws-server@55587 get
data: {"messageId":1,"type":"currentStatusResult","params":{"status":{"app_status":"busy","busy_resources":[{"name":"looper","description":{"thread":"\"LooperIdlingResource-168-mqt_js\" (JS Thread)","execution_type":"JavaScript code"}},{"name":"looper","description":{"thread":"\"LooperIdlingResource-169-mqt_native_modules\" (Native Modules Thread)","execution_type":"native module calls"}}]}}}
20:51:38.143 detox[7027] i ws-server@34886 send
data: {
"messageId": 1,
"type": "currentStatusResult",
"params": {
"status": {
"app_status": "busy",
"busy_resources": [
{
"name": "looper",
"description": {
"thread": "\"LooperIdlingResource-168-mqt_js\" (JS Thread)",
"execution_type": "JavaScript code"
}
},
{
"name": "looper",
"description": {
"thread": "\"LooperIdlingResource-169-mqt_native_modules\" (Native Modules Thread)",
"execution_type": "native module calls"
}
}
]
}
}
}
Could a moderator please reopen this issue?
@noomorph thanks!
Thank you for your understanding. Due to ongoing wars in our countries, our current bandwidth is limited. Typically, investigations like yours require several dedicated days, and the timeframe can extend if complex issues arise. My tasks are scheduled based on the priorities set by my company, so I can't promise I can look at it in the near future.
Overall, I understand the frustrations with issues like this. We're all looking forward to a resolution, but until we or someone else has time to get this done, such investigations will be held manually.
So, were I to have more resources, I'd go all in on obtaining that profiler recording, be it through Flipper or some native Android profiling method. It seems to be the most direct approach to addressing this concern. 🤷♂️ Get to know which function is running in your flamechart, and you know the culprit.
@noomorph understandable and I hope you and your colleagues are safe.
I have tried the Android profiler method running my local dev env, however the issue only reproduces in CI on Linux machines. Our team only uses macos machines so we are limited in our ability to reproduce and debug it.
I am open to creative solutions on how to debug this. I've considered spinning up a separate Ubuntu machine in AWS just to see if there are any fundamental issues with running our app on the AMD architecture.
Any and all ideas welcome :)
@owens-ben if you are really open to any suggestions, maybe you could try to spin up flipper-server - first locally, then on CI?
https://www.npmjs.com/package/flipper-server
I hate to admit that this seems to be a rarely used experimental package, but if I get their idea right, it can serve a full-fledged Flipper UI via a browser. If this works, and it has no easy way to start recording via http request, maybe you could click on some buttons via puppeter (sounds bananas but might be viable).
Could you check that please?
One of my more senior teammates was able to help with this and get it running on a concept level. We will be compiling our findings. If there are any suggestions for anyone that runs into this problem we will share them here.
@owens-ben, if your teammates eventually will be okay with releasing the source code of that "concept level", we'd highly appreciate this input. 🙏 I plan to work very seriously around the artifacts subsystem in Detox in Q4'23-Q1'24, and any viable POC can accelerate the appearance of generic Flipper artifact recording in Detox.
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.
@noomorph I hope you are well. Do you have any news about this fix?
What happened?
After going through much debugging with Bitrise support we believe there is some kind of issue with the launchApp() function. It's either timing out or just not running at all.
https://support.bitrise.io/hc/en-us/requests/36123
I ran a "dummy" test with no app launch and that seems to run fine.
Here is the stack dump from when this happens.
Detox v 20.5.0
What was the expected behaviour?
No response
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.5.0 React Native version: 0.70.6 Has Fabric (React Native's new rendering system) enabled: (yes/no) Node version: Device model: Android version: 31 Test-runner (select one): jest
Detox logs
Detox logs
``` paste logs here! ```Device logs
Device logs
``` paste your device.log here! ```More data, please!
No response