ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Lindner <daniel.lind...@abas.de>
Subject Re: <junit> slow?
Date Thu, 21 Dec 2006 10:09:12 GMT
Matt Benson wrote:
> Has anyone ever noticed Ant running junit tests
> exceedingly slowly, perhaps only in the case of
> testsuites or nested testsuites?  I am looking at a
> testsuite that has about 600 child tests, which all
> run in < 2 seconds in Eclipse's JUnit runner, but take
> 15-20 minutes in Ant.  :|

Just to make sure you don't fall in the same trap as me:
Eclipse uses a "one jvm instance for all tests" approach. Thats as fast 
as one can get.

If you run your tests on a network drive with the ant junit task, it 
will severely slow down the execution. I guess these are caching effects 
on eclipse's side.

The next thing to look for is the "forkmode" attribute of ant's junit 
task. It defaults to "one jvm per test class" (perTest). That creates 
additional overhead for every testclass you use. Using Testsuites 
indicates many test classes, so i suggest you check that neither the 
junit task nor the batchtest tasks (if any) have the default forkmode set.
http://ant.apache.org/manual/OptionalTasks/junit.html

I hope that helped. This issue bugged me for a while, i think the 
default value for forkmode is broken - if you watch it from an 
"eclipsed" point of view.

Sincerely,
Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message