Is your feature request related to a problem? Please describe.
Since on Android, the Detox manager is only initialized _after_ the activity is successfully launched, exceptions associated with crashes in the activity launch itself do not get reported back to the tester, and thus leave the tester to run until timeout.
After that, the only reasonable way to figure out what happened is by digging the logs inside the artifacts -- and only if such have been recorded to begin with.
This is far from ideal.
Describe the solution you'd like
'Need to somewhat reorganize the init flow so that the web-socket and crash handler could be set up before everything else (in particular, activity launch).
Describe alternatives you've considered
N/A
Additional context
I've struggled with this in trying to decipher timeout taking place on the Wix internal CI.
This is a duplicate of https://github.com/wix/Detox/issues/1446. In that, me and @noomorph considered a watchdog-type solution to this problem. This can be closed in favor of the older issue.
iOS has the same issue, BTW.
hmm while the issue is largely the same I can't close this right off the bat because it also describes a solution which seems unnecessary for Android. It currently seems feasible to me that with minor init flow changes it could be easily achieved with no added infra work (namely, adding a watchdog -- in essence, you can say the technique is already provided by Android, just need to utilize it properly).
Sounds like there is an exact problem as iOS鈥攊f there is a crash somewhere in the flow leading up to framework load, Detox is currently not aware. How does Android solve this?
On Android the test code is executed via instrumentation, the app and UI are orchestrated by it so in essence you're the watch-dog. It has an inherent utility for launching android activities with a bound monitor that times out after 45 seconds.
Now that you mention it, on the Detox rewrite, this will also be possible in the test runner process. 馃
So any chance we could merge the two issues? Generalize the description?
I will close the old one, and let this stay Android only. Otherwise, you won't be able to close it when Android is ready and iOS rewrite is vaporw... in development. 馃槀
Most helpful comment
Now that you mention it, on the Detox rewrite, this will also be possible in the test runner process. 馃