Disable RN Timers and Animation synchronization to prevent tests from stalling

See original GitHub issue

Is your feature request related to a problem? Please describe. It’s related to a problem we’ve been facing at Skyscanner. Some of our tests were stalling in Android because of ReactNativeTimersIdlingResource.isIdleNow() and AnimatedModuleIdlingResource.isIdleNow() never returning true in some cases. I couldn’t identify exactly when this happens since some of the times this happened we didn’t have any infinite animations running in that particular screen.

Describe the solution you’d like We already have the disableSynchronization() function but that’s only disabling the network synchronization. So my proposal is to add similar methods to disable RN timers synchronization and animation synchronization. You can see an already implemented version of this here: https://github.com/leanmazzu/Detox/commit/efb0dcfd799ffea3d91bd1c8e46ee84df3950dd6. This is what we currently have in place in our Skyscanner fork and it’s working just fine for us.

Describe alternatives you’ve considered N/A

Additional context This would be a non-breaking change as it’s not modifying the current disableSynchronization() method or anything else.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:45 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
d4vidicommented, Mar 22, 2020

@Grohden kudos for getting that fixed - even though that in essence, I advise not to disable animations in E2E-level testing. Rather, in our projects, we’ve force-disabled animations mocking altogether: https://github.com/facebook/react-native/issues/27010#issuecomment-573645965

3reactions
mnzakicommented, Sep 16, 2019

I’m hitting a similar issue, UIManagerModule is always busy (because of a looping animation). Was about to implement disable myself but found this! Thanks @leanmazzu for the PR!

@maxime-helen I found it useful to check the instrumentation app logs: adb logcat *:S Detox:V -T 50 If your app is stuck and those actions are timing out then check the logs for messages like "UIManagerModule is busy"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing With Synchronization Issues in Tests | Detox
If you have an endless looping animation, this may cause Detox to hang. In this case, consider turning off the animation synchronization or...
Read more >
Animated Button block the Detox - Stack Overflow
Detox provides disableSynchronization() - so you can temporarily disable synchronization to work around an animation and then turn it back on ...
Read more >
Implementing Detox End-to-End Testing | by Chris Lew
We disabled animations in order to avoid any potential flakiness in our end-to-end tests. We have found that simulators/emulators can become ...
Read more >
Online tera raids are horrible. Even the solo ones are kinda ...
Not to mention terastalyzing also adds extra animation time to any attack ... When will people stop using weak ass Pokémon in terra...
Read more >
[Update: Dec. 22] YouTube bugs/issues & pending ...
Update: The issue on ESPN freezing on YouTube TV has been fixed. ... A simple force stop/clear cache should fix the issue though....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found