Retrying Android Tests and Clearing the Database Between the Runs

Intro While great minds are arguing with each other about whether it is better to disable flaky tests or to retry them, I’d like to show you the way how you can achieve the latter. This is for the brave, so do it at your own risk! 🤠 Implementing retry strategy Let’s create two classes: Retry - this one will be able to retry any specific test RetryRule - this one will be responsible for the whole…