Question

I've just started having a proper play with Powermock and noticed that it slows down test startup immensely. A quick look at top while it was running shows that mount.nfts-3g was taking up most of the CPU. I moved Eclipse and my source directory to ext3 partitions to see if that was a problem and the tests now startup quicker but there's still a noticeable delay. Is this normal with Powermock or am I missing something obvious?

Was it helpful?

Solution

PowerMock is a bit slower at startup since it uses it's own classloader but the time needed also depends on how you write the tests using PowerMock. For instance if you are using the PrepareForTest annotation at the class or method level of your test. If you're using it at the method-level a new classloader is created for each test-method. The time may also depend on the junit fork mode.

OTHER TIPS

Try to run Powermock without Eclipse. Does the same symptoms occur?

Mock veeery small units. Is the performance loss as high as before?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top