I'm testing my Android app with Robolectric but I faced a weird situation. What happens is that when I run some set of tests, the first test ran with Robolectric takes much more time than any other test. It is not specific from the test itself, since I tried different configurations on the order of the tests and the result is that the first test is always the slowest.
Is it any Robolectric setup time or something like that? Any information provided is useful.
Yes, this is setup time. Unfortunately there are no central place where you can gather all information about Robolectric
.
Watch this presentation and you will find more explanations on pages 28, 29, 30, 35.
If you're interested the Robolectric
changed some approaches in version 2.0. Significant changes are:
Javaassist
usage replaced with ASM
usage - for speedup start time If you use gradle
then take a look also on robolectric gradle plugin . The added running tests in parallel and other tuning options. The running tests in parallel apparently useful only with big amount of tests (hundreds+)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.