Detox gets stuck on JS Timer/Main Run Loop when registering a lot of screens with React Native Navigation Detox gets stuck on JS Timer/Main Run Loop when registering a lot of screens with React Native Navigation

I have a React Native app that is using React Native Navigation, and this app registers a lot of screens with RNN at bootup (83 screens, to be precise). When I try to run a Detox E2E test against the app, Detox reports that the system is busy:

detox[1831] INFO:  [APP_STATUS] The system is busy with the following tasks:

Dispatch Queue
⏱ Queue: “Main Queue (<OS_dispatch_queue_main: com.apple.main-thread>)” with 1 work item

JS Timer
⏱ 3536

Run Loop
⏱ “Main Run Loop”

One thing I've found that prevents this is when I comment out most of the RNN screen registration calls, leaving only the essential screens to run the tests. When I do that, the Detox tests run just fine. What also helped was to switch all of the import calls for the RNN screens being registered to inline requires. But this loses us our type checking for all of those screen components. I have tried using Navigation.setLazyComponentRegistrator() and I still get the Detox timeouts.

I've been all over the app looking for stray JS timers or animations, to see if there's something I'm missing that the RNN registration calls are just exacerbating. But I'm at a loss at this point.



from Stackoverflow

Comments

Popular posts from this blog

How to extract items from a subarray and push them to the main array

\\u0000 cannot be converted to text error \\u0000 cannot be converted to text error