Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Performance degradation when upgrading from Robolectric 3.0 to 3.1 #2522
We are trying to upgrade to Robolectric 3.1 from version 3.0 which has been very stable and predictable. We currently have 700 tests that take about 4 minutes to run. We use Dagger and have a TestModule that uses Mockito so we can mock our Activity/Fragment dependencies. After upgrading to 3.1, the tests are about 10 times slower or just hang indefinitely.
One thing we noticed is that Robolectric now seems to layout ViewGroups that it was not laying out before. In order to compensate for this, we were manually calling ViewGroup.layout() to test Activities/Fragments that use RecyclerViews, as suggested in this post - http://stackoverflow.com/questions/27052866/android-robolectric-click-recyclerview-item.
Can you confirm that this was changed in Robolectric 3.1 and if so, do you think it could cause tests to take significantly longer. Also, were there any other major changes to the library's internals that you think could cause memory/performance issues?