-
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
Tests hanging on before_all hook #155
Comments
Looks like your configuration is valid. It looks like the device doesn't return a What version of detox do you use ? |
I'm running node version 8.0.0, detox version 5.0.12. |
Nothing seems to be wrong with your simulator log. Does the app crash ? did you try running in with ios.sim.debug ? |
Nope, it does not crash, it just remains idle in foreground. Sure, I'll try again soon and post my results. Thanks :) |
Ok, so I gave detox@5.1.0 a try and the same thing happened: builds, installs and lanches correctly, but hangs before running test cases, both in release and debug configurations.
Simulator logs: |
same @vspedr |
By the way, I'm using react native version 0.44.2 |
Hi ! Same problem for me. |
@vspedr do you see the app loading on simulator screen ? Can't get a full understanding of what's happening yet, but this is what I understand form the logs:
|
Hello @rotemmiz, Is there any other info I can get to help you? EDIT: I just noticed 5.2.0 has been released, will give it a try ASAP |
Hello guys, I work with @vspedr and today I built detox (5.2.0) from scratch in our project and unfortunately the error persists. I used node 7.6.0, 7.8.0 and 8.1.3 with xcode 8.3.3 (Simulators: iPhone 5, iPhone 7, iPhone 7 Plus) using react-native 0.44.2. |
I think Detox tries to throw an error inside mocha's |
Hello @rotemmiz , thank you for your quick response, but, unfortunately, the code doesn't reach the exception 😢 |
Hmm.. :( Let's try to see if the device even tries talks back to the tester. and then run |
Hello @rotemmiz, first of all sorry for the delay. I'd like to ask you how do I get the SessionId for my app? 🤔 |
It is whatever string you want there |
Thank you @rotemmiz, this is what I get: detox-server info 07:46:22: server listening on localhost:8099...
detox-server wss 07:47:53: role=tester login (sessionId=123)
detox-server wss 07:48:28: role=tester action=isReady (sessionId=123)
detox-server wss 07:48:28: role=testee not connected, cannot fw action (sessionId=123)
detox-server wss 07:49:53: role=tester disconnect (sessionId=123)
detox-server wss 08:01:38: role=tester login (sessionId=abcdef)
detox-server wss 08:01:45: role=tester action=isReady (sessionId=abcdef)
detox-server wss 08:01:45: role=testee not connected, cannot fw action (sessionId=abcdef) |
Yep, the device never connects to the websocket server. |
I seem to be having the same issue. I'll dig a little and try and provide some debug info |
Trying to run
|
@adamski, does 'detox test' work? Did you 'npm install' ? Are you running from your project's root dir? |
@rotemmiz yes |
@rotemmiz I noticed the detox-server is a separate node module, i.e. at |
@rotemmiz got it working with Similar to @mCodex I get the following output from the
Xcode output shows one of these around every second:
I realise this is a known issue for iOS 10, just wondering if there Is there some Plist item missing to allow web socket connections that might preventing the connection? |
@rotemmiz Not sure how to proceed, I've followed the steps at https://github.com/wix/detox/blob/master/docs/Guide.DebuggingInXcode.md - can't see anything obvious that might relate to the 'device code' you mention. |
Try setting breakpoints here https://github.com/wix/detox/blob/master/detox/ios/Detox/DetoxManager.m#L76 and here: https://github.com/wix/detox/blob/master/detox/ios/Detox/DetoxManager.m#L90 Is the websocket client even connecting ? |
OK thanks, just not sure how to get to the DetoxManager.m file? I can only see the header drilling into the framework in Xcode. |
If you followed the Xcode debugging steps you should have the framework linked to your project: |
@fighterpoul for us iOS noobs, where did you remove the |
This issue seems to have been introduced with the 5.6.0 release. Reverting back to 5.5.1 sorts the issue of the simulator hanging and not calling back. |
What version of Xcode are you using? |
@fighterpoul @adamski Guys, why are you building with the Detox is 64-bit only—only x86-64 and arm64 slices are provided. i386 is 32-bit architecture and I would like to understand why you are building in 32-bit only. This is not something you should do—standard architectures in Xcode normally include 32-bit and 64-bit. |
@rotemmiz 8.2.1 I've checked out the repo and am currently taking a look. It gets stuck in
It never resolves. I've noticed the |
I'm out of ideas @rotemmiz. I'll try and find some time to continue looking into this if noone else has a chance, however I doubt I'll find time until early next week. In the meantime I'll carry on with 5.5.1, launch date is looming large! |
@LeoNatan as I mentioned before - I don't remember why I was needed to use the flag (probably I had some build issues). I do remember that after reinstalling all tools used by Detox and making sure that all are installed according to documentation and removing the flag everything started to work fine. @johnnycopperstone in a config file you have build command, here's the doc: link |
That flag is not related to RN. It tells Xcode to build a 32-bit application. We dropped 32-bit support from Detox a while ago because it wasn’t really needed—since a few years Apple requires 64-bit binary support. So there is no reason to build 32-bit only builds, unless specifically debugging an issue related to 32-bit; in such cases, Detox is not supported. |
I'm having the same issue. Not happening on a release build, but stuck on the debug build. |
I have got it fixed by doing a re-install of all node modules and a |
I am hitting this issue, but only in CircleCI. Running a clean rebuild with cache cleaned, does not fix it. Locally, everything is fine. |
Hi, see
react native: 0.47.2 2017-09-12 00:09:20.040 karmaMobile[57587:1695265] ☣️ DETOX:: Removing observed timer 1 |
An update on @timsawtell-sportsbet's issue: we are running Detox in a hybrid React Native / Native app. Since no React Native components render on the home screen of our app, the There's a fundamental assumption in Detox that if your app has React Native symbols linked into it, then it will be a purely React Native app and you're guaranteed to have The solution in our case was simple, we manually fire an
|
I faced it again today. For me the issue occurs after I installed |
I'm getting a similar error when I run it on Travis CI. Locally works fine Node v8.4.0
yarn list v0.24.6
├─ detox@5.6.2
├─ mocha@3.5.2
└─ react-native@0.48.2 The command "detox build --configuration ios.sim.debug" exited with 0.
125.32s$ detox test --configuration ios.sim.debug --cleanup
node_modules/.bin/mocha ./__e2e__ --opts ./__e2e__/mocha.opts --configuration ios.sim.debug --cleanup
detox-server info 20:30:13: server listening on localhost:52073...
detox info 1: Listing devices...
detox info 3: Launching device 15E2107D-EAD2-4E1F-8BC3-59E58E750FB1...
detox info 4: Waiting for device 15E2107D-EAD2-4E1F-8BC3-59E58E750FB1 to boot...
detox info 4: Device 15E2107D-EAD2-4E1F-8BC3-59E58E750FB1 booted
detox info 5: Uninstalling co.torch.Torch...
detox info 6: Installing /Users/travis/build/MyProject/ios/build/Build/Products/Debug-iphonesimulator/MyProject.app...
detox info 6: Installing /Users/travis/build/MyProject/ios/build/Build/Products/Debug-iphonesimulator/MyProject.app...
detox info 6: /Users/travis/build/MyProject/ios/build/Build/Products/Debug-iphonesimulator/MyProject.app installed
detox info 7: Terminating co.MyProject...
detox info 7: co.MyProject terminated
detox info 8: Launching co.MyProject...
detox info 8: co.MyProject launched. The stdout and stderr logs were recreated, you can watch them with:
tail -F $HOME/Library/Developer/CoreSimulator/Devices/15E2107D-EAD2-4E1F-8BC3-59E58E750FB1/data/tmp/detox.last_launch_app_log.{out,err}
1) "before all" hook
0 passing (2m)
1 failing
1) "before all" hook:
Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
child_process.js:634
throw err;
^
Error: Command failed: node_modules/.bin/mocha ./__e2e__ --opts ./__e2e__/mocha.opts --configuration ios.sim.debug --cleanup
at checkExecSyncError (child_process.js:591:13)
at Object.execSync (child_process.js:631:13)
at Object.<anonymous> (/Users/travis/build/MyProject/node_modules/detox/local-cli/detox-test.js:46:4)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Function.Module.runMain (module.js:609:10)
at startup (bootstrap_node.js:158:16)
The command "detox test --configuration ios.sim.debug --cleanup" exited with 1.
Done. Your build exited with 1.
/Users/travis/.travis/job_stages: line 166: shell_session_update: command not found Already tried:
Any thoughts? |
Hey, I'm having the same issue. Version:
My config in
I run For me, it also hangs in
And the result in the terminal:
The output from my system log is
It seems to me that the issue is at Anyone have any ideas? |
I'm having the same problem on Android. Any suggestion? More details here, #96 Thank you |
Hello, We are moving support questions to Stack Overflow. Please ask a question there with the Thanks |
I'm using the latest version of detox (7.3.3), and this still seems to be an issue. I get When I run with the detox testing tools, (ios.none), it all works. |
Please open a new issue and provide all required information. Thanks |
Submitted new ticket #689 |
I am also facing same issue could anyone provide solution
node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.sim.debug --grep :android: --invert (node:38487) ExperimentalWarning: The fs.promises API is experimental 0 passing (2m)
|
If you running in expo, make sure hostType in .expo/settings.json is set to tunnel. |
@illyax did that, but the problem remains. |
When I run
detox test --configuration ios.sim.release --loglevel verbose --cleanup
, the app is successfully installed and launched, but it won't proceed to run my test cases because it's stuck on thebefore()
function ininit.js
.I tried running the sample project but I couldn't reproduce the issue :/ any ideas?
init.js:
configuration in package.json:
The text was updated successfully, but these errors were encountered: