-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Detox + Expo + jest : timeout on opening the app #1422
Comments
Please enable debug synchronization and post the log here. Thanks |
Here you go (sorry I had posted the wrong log in another comment I deleted):
|
I see from the log that you are trying to use |
Thanks for looking into it @LeoNatan.
The project was just created with expo init and displays the welcome screen, so there is no real code that can fail at that level. When you say 'something on your end' do you mean the expo client ? or the tests themselves ? |
Also (this may be useful info) I have no problem using detox on the standalone built app that is generated from that project, only when trying to use detox with the expo client itself. |
My guess would be the tests, since I don't see the app being stuck in sync issues... |
Mhhh, I'm not sure what part of the test it could be:
If you look at that repo https://github.com/jeromecornet/expotest, it's just after running Rather than a bug in the test, it looks to me like the the websocket send call in Client.js#sendAction (which ultimately gets called in both situations) does not resolve. |
I am sorry, I am not familiar with expo at all. But it seems like the app is running, and I don't see anything in the log that shows me that detox is stuck in sync. Could you maybe set the sync print to something like 200 rather than 3000? But again, 3000 should still be enough to see if it is stuck. |
It actually does the same in ejected app #1187 |
Sorry guys, I don’t know how to debug this. If someone is willing to step up and help, it would be greatly appreciated. |
Our detox with expo tests stopped working after detox 12.3.0. Thanks for the minimal example, I can try and confirm tomorrow and offer something useful or confirm |
Was anyone able to find a workaround for this? or a version of detox where it works? |
Confirming 12.3.0 fixes the issue for me, don't have any solutions at this time. |
|
This also happens to me - Expo only works with detox 12.3.0. |
Please use the new debug option documented here to see why Detox hangs on launch. Add the |
Thanks @LeoNatan Here's what I got:
The output of detox test shows
So it looks like it's not detecting that the app has finished loading. Now on the other hand, I managed to find a workaround: launch expo without any app, set the live reload blacklist then call device.openURL In my prior tests, the device.openURL would fail because I did not specify the Blacklist for live reload and it got stuck waiting for the /onchange call to be dealt with (which I discovered using the EarlGreyStatistics) |
Hm, it seems the load operation is not ending and that's why it's stuck. Could be that Expo is using some RN configuration or load type that we are not familiar with. Not sure what you mean in your workaround, but I guess it's good that it exists. Unfortunately, as I said, I don't have the resources to debug Expo. If someone can reproduce the same loading behavior in an empty example project, I'll take a look. If someone is willing to debug this issue, I'll provide assistance. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Please use StackOverflow for general usage questions. This question is specifically about Expo. |
@jeromecornet since |
@wolverineks I haven't debugged the issue besides running the few commands manually (see the linked repo with the test case to reproduce the problem). |
I've tried debugging this a little, all I know so far is that when you load a detox application (ie
|
Well think I found the offending commit 32be293 Reverting this commit works for me with the latest detox, can any other expo users confirm? I think that change broke passing in a url blacklist on launch? From the detox docs for device-launch It seems after the commit passing a blacklistregex to launchArgs like
(see: detox-expo-helper#L105) to DetoxManager.m no longer works? Sorry I don't have the obj-c debugging chops to be certain right now. |
Hi @brookemitchell diff --git a/node_modules/detox/src/devices/ios/AppleSimUtils.js b/node_modules/detox/src/devices/ios/AppleSimUtils.js
index 72b8d3a..391930e 100644
--- a/node_modules/detox/src/devices/ios/AppleSimUtils.js
+++ b/node_modules/detox/src/devices/ios/AppleSimUtils.js
@@ -280,7 +280,7 @@ class AppleSimUtils {
}
_joinLaunchArgs(launchArgs) {
- return _.map(launchArgs, (v, k) => `-${k} "${v}"`).join(' ').trim();
+ return _.map(launchArgs, (v, k) => `-${k} ${v}`).join(' ').trim();
}
async _launchMagically(frameworkPath, udid, bundleId, launchArgs, languageAndLocale) {
|
Thanks I'm applying the same patch for now (😄 patch-package). I know the double quote->arguments map fixed an issue with url argument splitting (see: #1294). Maybe the more comprehensive fix is to look at how |
Hi, this certainly fixes the issue so huge thanks! |
@maitriyogin Not yet, it's one of those cases where a change solved the issue for another use case (multiple argument urls). Solution is to write tests for both use cases and fix it, just haven't had the time yet. |
According with our statement here, I am closing this issue. General Expo questions are no longer allowed. Please follow these issues with the Expo team or in the Expo community. Thanks! |
Describe the bug
Detox tests timeout waiting for the return of app opening methods.
using the detox-expo-helpers , both reloadApp() and device.openUrl({ url }) hang while waiting for the device response.
It looks like the Device Driver deliverPayload does not return.
To Reproduce
Here is a repo (basically I just ran expo init and detox init -r jest)
https://github.com/jeromecornet/expotest
You will note that device.launchApp without a url returns, but does not with a url launch parameter.
Also I can use the standalone app (not via the expo client) and it works fine, this seems to be specific to the expo client.
Expected behavior
Both launch methods should return.
Environment (please complete the following information):
with expo 32.0.0
Device and Verbose Detox Logs
The text was updated successfully, but these errors were encountered: