Prev – The problem with duplication
We use Ant and we were using fork=”yes” option of the ant junit task. After reading more, I understood that when fork option is turned ON, the default forkmode option is set as “perTest”. i.e. for every TestClass a new JVM gets created. Now this is an expensive operation. Instead of “perTest”, I used “once” option, which creates only one JVM for all the tests. With this option, the tests started failing due to permgen errors. After increasing the permgen memory size, the tests ran faster. The time was reduced further by about 20 minutes for our unit tests, though it was still taking over 30 minutes to run. Our SAS integration tests were still taking 50+ minutes to complete.