Detox: thrown: "Exceeded timeout of 120000 ms for a hook.
Description
When running the tests locally on my machine, the test work as expected. However on CircleCI I receive the described errors. It seems like the app is being installed and uninstalled in a loop, very strange.
- I have tested this issue on the latest Detox release and it still reproduces
Reproduction
I’m not 100% sure how to reproduce this since this is only happening on CircleCI and Travis too. I’ve tried to set the environment running on CircleCI to be as identical to my machine as possible. Both have the same Node, Xcode and Homebrew versions. The only difference is I’m running on M1 12.1 and CircleCI uses macOS 11.6.2
Expected behavior
The tests should initiate and run on both environments.
Environment
- Detox: ^19.4.5
- React Native: 0.67.2
- Node: 14.19
- Device: iPhone 12
- Xcode: 12.5.1
- iOS: Probably 12
- macOS: 11.6.2
- Test-runner (select one):
jest-circus
Logs
If you are experiencing a timeout in your test
- I have followed the instructions under Identifying which synchronization mechanism causes us to wait too much, I have read synchronization debug documentation and am providing the relevant synchronization debug output below:
If you are seeing a Detox build problem (e.g. during npm install
, not detox build
)
- I am providing the
npm install
log below:
Npm logs
(paste logs here)
Device and verbose Detox logs
- I have run my tests using the
--loglevel trace
argument and am providing the verbose log below:
Detox logs
GitHub doesn’t allow me to upload such a large file (maximum body exceeded, 65536 chars). Full logs can be found here: https://drive.google.com/file/d/1ZSdd-nIGv1dWgua2lsu4tqhLcZvfNos6/view?usp=sharing
Device logs
I'm not sure how to get these from CircleCI. Can someone help me with that?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 16 (4 by maintainers)
Commits related to this issue
- github actions: https://github.com/wix/Detox/issues/3218 — committed to zhyd1997/generator-jhipster-react-native by zhyd1997 6 months ago
Thanks @gunnartorfis, I will go over the logs and the configurations you provided.
Also, regarding:
Try
echo "[]" > ~/Library/Detox/device.registry.state.lock
. That’s probably because the desired simulators are locked in this file. See: https://wix.github.io/Detox/docs/guide/parallel-test-execution/#lock-fileIt’s still behaving a bit weird, like it’s constantly restarting the simulator or something, eventually reaching an error
thrown: "Exceeded timeout of 120000 ms for a hook. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
.It also might be worth mentioning that when running the tests locally, Detox spins up a new simulator. For example, if I declare “iPhone 12” in my `.detoxrc.json’, that one will fire up but tests will run on “iPhone 12-Detox”. Not sure if that’s normal but wanted to mention that.
Here’s a link to the output logs: https://drive.google.com/file/d/1Fcfyy_wGZfsrAF5vHBCqRFOOhQSwec7s/view?usp=sharing
Here’s my Detox config.json:
environment.js:
init.js:
.detoxrc.json
Actually this shouldn’t be related to the error… changing direction 😅
Please check what happens when you don’t set permissions when calling
launchApp
@gunnartorfis I’m not sure why your
init.js
is required. Detox init and cleanup is done automatically in a jest-circus environment, such as yourself. That alone might be a source of some of the issues 🤔