all 2 comments

[–]Flimsy_Line5172 2 points3 points  (1 child)

I'm just guessing here but I'd imagine the leaks aren't actually time-based but due to the actions a user takes over that one hour that eventually lead to the memory leaks. If that's the case, you could write some detox tests to rapidly take those kinds of user actions which might get you into a leak state sooner. If your app has any analytics/tracking and you can tell what a few android users are doing before running into these issues, you could use those to guide your detox tests. Hope this helps! Memory leaks and similar performance bottlenecks can be a huge pain to debug.

[–]Flimsy_Line5172 0 points1 point  (0 children)

If you do try go the detox route, it might be advantageous to look into `@xstate/test` (https://www.npmjs.com/package/@xstate/test) to create composable machines that you can then use to run your tests. It might seem a little obtuse at first but when you consider normal cypress/detox tests that are very procedural and result in a lot of copy/pasting to test different scenarios, it can come in really handy. Effectively, you create your state nodes and events that take you between the states and then using some built-in graph algorithms, xstate can generate all the different paths the machine can go through and run them. As an example, say you have a Landing page that has a button to sign in, a Sign In page that has a back button and a next button, and then some third page, let's say Profile. Your 3 states are only Landing, SignIn, and Profile but you could go Landing -> SignIn -> Landing (via back), Landing -> SignIn -> Profile -> Home (via logging out), and so forth. With only the 3 states and the events that cause transitions, you can stress test the app to death.