Unstable Terrain

Software development in the real world

Ant Junit task : batchtest fork=true or false?

leave a comment »

Saw Erik Doernenburg’s presentation about continuous integration. In it, he mentioned that most of the time spent running junit tests is spent starting up the JVM as a result of the fork="true" setting.

It’s ‘best practice’ to fork the jvm for each test to avoid side effects of tests. However, if you happen to not suck at software development, then you will have few to none that side-effect like this (if you do, then run your junit tests in two batches).

I tried it on a few projects at work and each project experienced substantially reduced build times (up to 50% reduction). There were a few issues to do with Hibernate (batch sizes in HSQLDB) but for the most part, it just worked.

Addendum: code coverage tools may require additional changes.


Written by Trent

July 17, 2010 at 12:07 am

Posted in Software Development

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: