You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Laura Dean <lg...@cyrusinnovation.com> on 2010/07/22 00:33:14 UTC

junit tests running slower in 1.8 than in 1.7

My team has a unit test suite that ran in about a minute and a half
with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
found via google is here, but it doesn't shed much light on the
subject:

http://netbeans.org/bugzilla/show_bug.cgi?id=182263

We're running junit with fork=yes and forkmode=once.  With forking
turned off, the tests run much faster, about the same as in 1.7.  (But
we want the forking for other reasons.)

We're running under Windows, with jdk 1.6 and junit 4.5.

Have you seen this problem and worked around it?  Is it a known issue,
or a problem with our configuration?

For the curious, I've created a simplified project here:
http://web.mit.edu/lgdean/Public/test-project.zip .  I've also
attached test results below, showing the difference (with much smaller
numbers), and a snippet of the build.xml file.  Any advice would be
appreciated.

Thanks,

Laura



C:\ant-trouble\my-project>ant -version
Apache Ant version 1.7.1 compiled on June 27 2008
C:\ant-trouble\my-project>ant test

test:
    [junit] Testsuite: SomeJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.042 sec
    [junit]
    [junit] Testsuite: SomeOtherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.032 sec
    [junit]
    [junit] Testsuite: YetAnotherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.034 sec
    [junit]


C:\ant-trouble\my-project>ant -version
Apache Ant version 1.8.1 compiled on April 30 2010
C:\ant-trouble\my-project>ant test

test:
    [junit] Testsuite: SomeJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.044 sec
    [junit]
    [junit] Testsuite: SomeOtherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.122 sec
    [junit]
    [junit] Testsuite: YetAnotherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.108 sec
    [junit]


    <target name="test">
        <junit fork="yes" forkmode="once">
            <formatter type="brief" usefile="false"/>
            <classpath> [...] </classpath>
            <batchtest>
                <fileset dir=".">
                    <include name="**/*Test.java"/>
                </fileset>
            </batchtest>
        </junit>
    </target>

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-07-23, Stefan Bodewig wrote:

> On 2010-07-22, Laura Dean wrote:

>> For the curious, I've created a simplified project here:
>> http://web.mit.edu/lgdean/Public/test-project.zip .

> I'll look into it.

Can't see any major differences between 1.7.1 and 1.8.1 on my Ubuntu
box.  Unfortunately it will be a bit more than a week until I'll get
access to a Windows machine again.

Stefan

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-08-08, Michael Ludwig wrote:

> Stefan Bodewig schrieb am 08.08.2010 um 22:12 (+0200):

>> Finally I found the reason - the enhancement that is Bugzilla Issue
>> 31885.  Ant writes output synchronously in order to support advanced
>> test UIs.

> https://issues.apache.org/bugzilla/show_bug.cgi?id=31885

> Great you found the cause! I might be wrong, but I think this kind
> of IO is simply referred to as "unbuffered IO", whereas "blocking",
> "non-blocking" and "asynchronous IO" would involve device readiness.

Neither term is what I meant (and yes, I am aware of the differences, my
language was just sloppy 8-).

Ant's test runner buffers all output of all tests and flushes it to the
test formatters once a testsuite finishes (I'm glossing over a few
details here), the "testevents" are sent to System.out immediately
rather than being buffered up - that's what I refered to as
synchronously since output is synchronous to the tests rather than
delayed.

Stefan

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Michael Ludwig <mi...@gmx.de>.
Stefan Bodewig schrieb am 08.08.2010 um 22:12 (+0200):

> Finally I found the reason - the enhancement that is Bugzilla Issue
> 31885.  Ant writes output synchronously in order to support advanced
> test UIs.

https://issues.apache.org/bugzilla/show_bug.cgi?id=31885

Great you found the cause! I might be wrong, but I think this kind
of IO is simply referred to as "unbuffered IO", whereas "blocking",
"non-blocking" and "asynchronous IO" would involve device readiness.

-- 
Michael Ludwig

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Laura Dean <lg...@cyrusinnovation.com>.
We tried it out, and our tests ran much faster.  We liked it so much
that we took the Ant 1.8.1 source and applied your change to it, so we
could use it for the time being.  We put the source here:
http://github.com/cyrusinnovation/Apache-Ant

Please note that we have no intention of maintaining this fork at all;
we just put it there for our convenience, and I mention it now it in
case it saves anyone else a little work.

Thanks again!

Laura

On Thu, Aug 19, 2010 at 11:10 AM, Laura Dean <lg...@cyrusinnovation.com> wrote:
> On Thu, Aug 19, 2010 at 8:54 AM, Stefan Bodewig <bo...@apache.org> wrote:
>> The change has been implemented in svn trunk[1] and may become part of
>> the next Ant release.  Using svn trunk my tests run as fast (or even
>> faster) as they do using Ant 1.7.1.
>
> Thank you very much!  We'll definitely try it out.

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Laura Dean <lg...@cyrusinnovation.com>.
On Thu, Aug 19, 2010 at 8:54 AM, Stefan Bodewig <bo...@apache.org> wrote:
> The change has been implemented in svn trunk[1] and may become part of
> the next Ant release.  Using svn trunk my tests run as fast (or even
> faster) as they do using Ant 1.7.1.

Thank you very much!  We'll definitely try it out.

> To be clear, the change only affects forked tests, is mostly invisible
> on anything but Windows and really only affects tests that finish in far
> less than 100ms.  If your average test takes several seconds, there
> won't be any difference between Ant 1.7.1 and 1.8.1.  Yes, tests run
> slower with Ant 1.8.x but generally not a lot.

That fits our experience exactly.  Our unit tests slowed down
dramatically, but our integration tests didn't.  I wish I had noticed
that difference at the time, but I was so focused on the unit-test
slowdown that I didn't really think about it.  (If anything, I
attributed the difference to the fact that we have so many *more* unit
tests.)

Laura

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-08-08, Stefan Bodewig wrote:

> I'll suggest to add a configuration option that will allow people to
> disbale those requests on the dev list, but right now I can't do more
> than confirm that forked JUnit tasks are slower with Ant 1.8.[01] than
> with 1.7.1.

The change has been implemented in svn trunk[1] and may become part of
the next Ant release.  Using svn trunk my tests run as fast (or even
faster) as they do using Ant 1.7.1.

To be clear, the change only affects forked tests, is mostly invisible
on anything but Windows and really only affects tests that finish in far
less than 100ms.  If your average test takes several seconds, there
won't be any difference between Ant 1.7.1 and 1.8.1.  Yes, tests run
slower with Ant 1.8.x but generally not a lot.

Ant's own testsuite finishes in a bit more that 15 minutes on my Windows
test system and has been sped up by less than six seconds with the
change - and this difference may very well be due to other influences.

Stefan

[1] http://svn.apache.org/viewvc?view=revision&revision=987139

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-08-02, Stefan Bodewig wrote:

> Now I can confirm I see some differences on the Windows machine as well.
> There is almost no difference for the tests that get run first (which
> take longer than the code-identical subsequent tests), so the warmup
> time hasn't changed much.

> I'll try to find the reason for this.

Found it, and there won't be a simple fix for it.

The reason really is Ant's changed I/O handling of forked processes and
that's why you see the impact on Windows.  I've taken the svn tag
matching Ant 1.7.1 and replaced two classes (StreamPumper and
PumpStreamHandler) with their Ant 1.8.0 cousins and see the performance
numbers of Ant 1.8.0.

With Ant 1.8.0 I/O handling has been changed on Windows to ensure Ant
doesn't hang indefinitely in the presence of grandchild-processes, so
without that change Ant simply doesn't wirk correctly and a loss in
performance is the price we have to pay.

What was puzzling me for a long time was why the changes affect the
forked VM at all when your testcases don't create any output - and even
if they did, output would be sent batched to the listeners at the end of
each testsuite.

Finally I found the reason - the enhancement that is Bugzilla Issue
31885.  Ant writes output synchronously in order to support advanced
test UIs.  Here you pay for a feature you don't want to use and in fact
if I disable these events, I get better performance than with stock Ant
1.7.1.

I'll suggest to add a configuration option that will allow people to
disbale those requests on the dev list, but right now I can't do more
than confirm that forked JUnit tasks are slower with Ant 1.8.[01] than
with 1.7.1.

Stefan

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-08-02, Laura Dean wrote:

> On Wed, Jul 28, 2010 at 6:44 AM, Stefan Bodewig <bo...@apache.org> wrote:

> ...
>> OK, I'll look into this when I get access to my Windows machine again
>> next week.  It didn't take more than the small test case you provided to
>> see the difference, right?

> Right.  The small test case was enough to see the difference, on the 2
> or 3 machines I tried, though not enough to make it very striking.

Now I can confirm I see some differences on the Windows machine as well.
There is almost no difference for the tests that get run first (which
take longer than the code-identical subsequent tests), so the warmup
time hasn't changed much.

I'll try to find the reason for this.

Stefan

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Laura Dean <lg...@cyrusinnovation.com>.
On Wed, Jul 28, 2010 at 6:44 AM, Stefan Bodewig <bo...@apache.org> wrote:
>
...
> OK, I'll look into this when I get access to my Windows machine again
> next week.  It didn't take more than the small test case you provided to
> see the difference, right?

Right.  The small test case was enough to see the difference, on the 2
or 3 machines I tried, though not enough to make it very striking.
(The numbers in my first message are from the small test case, to give
you some idea.)  Thanks,

Laura

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-07-28, Laura Dean wrote:

> I tried a few more things, with the following results:

Many thanks.

> * On windows, Ant 1.8 runs the tests slower regardless of JDK version
> (among 1.5.0_11, 1.6.0_17, and 1.6.0_21).

OK.

> * If I copy ant-junit.jar to the project directory and add it to the
> classpath, nothing changes.  The tests still run slower in 1.8.

This means a change in Ant's core is responsible, not in the JUnit task
itself.

> * Like you, I also couldn't reproduce the problem under linux.

OK, I'll look into this when I get access to my Windows machine again
next week.  It didn't take more than the small test case you provided to
see the difference, right?

Thanks again

       Stefan

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Laura Dean <lg...@cyrusinnovation.com>.
I tried a few more things, with the following results:

* On windows, Ant 1.8 runs the tests slower regardless of JDK version
(among 1.5.0_11, 1.6.0_17, and 1.6.0_21).

* If I copy ant-junit.jar to the project directory and add it to the
classpath, nothing changes.  The tests still run slower in 1.8.

* Like you, I also couldn't reproduce the problem under linux.

Laura

>> On Fri, Jul 23, 2010 at 1:10 AM, Stefan Bodewig <bo...@apache.org> wrote:
>>>
>>> On 2010-07-22, Laura Dean wrote:
>>>
>>> > My team has a unit test suite that ran in about a minute and a half
>>> > with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
>>> > 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
>>> > found via google is here, but it doesn't shed much light on the
>>> > subject:
>>>
>>> > http://netbeans.org/bugzilla/show_bug.cgi?id=182263
>>>
>>> Ant 1.8.0 changed some parts of the process execution logic to adapt to
>>> problems with hanging grandchild processes on Windows.  This changes
>>> have a side-effect (which we cannot seem to avoid) that causes any
>>> forked process to use up at least about half a second.  With 1.8.1 the
>>> same logic changes have been applied to other OSes as well.
>>>
>>> So if you build process was forking a lot of small processes, a major
>>> slowdown is to be expected.
>>>
>>> > We're running junit with fork=yes and forkmode=once.
>>>
>>> forkmode="once" should just create a single new process and you'd only
>>> be paying the overhead once - not for each test.  This is the first
>>> thing I'd look into, makesure there really only is a single VM forked.
>>>
>>> > For the curious, I've created a simplified project here:
>>> > http://web.mit.edu/lgdean/Public/test-project.zip .
>>>
>>> I'll look into it.
>>>
>>> Stefan
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>
>>
>

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Laura Dean <lg...@cyrusinnovation.com>.
It's definitely one JVM for all the tests.  I added code to increment
a static counter and to print it when each test ran.  The number never
reset to its initial value, which it would have done, if there had
been multiple VMs involved.

Laura

> On Fri, Jul 23, 2010 at 1:10 AM, Stefan Bodewig <bo...@apache.org> wrote:
>>
>> On 2010-07-22, Laura Dean wrote:
>>
>> > My team has a unit test suite that ran in about a minute and a half
>> > with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
>> > 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
>> > found via google is here, but it doesn't shed much light on the
>> > subject:
>>
>> > http://netbeans.org/bugzilla/show_bug.cgi?id=182263
>>
>> Ant 1.8.0 changed some parts of the process execution logic to adapt to
>> problems with hanging grandchild processes on Windows.  This changes
>> have a side-effect (which we cannot seem to avoid) that causes any
>> forked process to use up at least about half a second.  With 1.8.1 the
>> same logic changes have been applied to other OSes as well.
>>
>> So if you build process was forking a lot of small processes, a major
>> slowdown is to be expected.
>>
>> > We're running junit with fork=yes and forkmode=once.
>>
>> forkmode="once" should just create a single new process and you'd only
>> be paying the overhead once - not for each test.  This is the first
>> thing I'd look into, makesure there really only is a single VM forked.
>>
>> > For the curious, I've created a simplified project here:
>> > http://web.mit.edu/lgdean/Public/test-project.zip .
>>
>> I'll look into it.
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>
>

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Laura Dean <lg...@cyrusinnovation.com>.
I switched our real project to forkmode="perTest" and found that it runs
even slower (much slower), so it's clearly doing better than one VM per
test.  (I haven't ruled out something like one VM per class, though.)  I
won't have time to play more with the code until Monday, but I will look at
it then.

Laura

On Fri, Jul 23, 2010 at 1:10 AM, Stefan Bodewig <bo...@apache.org> wrote:

> On 2010-07-22, Laura Dean wrote:
>
> > My team has a unit test suite that ran in about a minute and a half
> > with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
> > 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
> > found via google is here, but it doesn't shed much light on the
> > subject:
>
> > http://netbeans.org/bugzilla/show_bug.cgi?id=182263
>
> Ant 1.8.0 changed some parts of the process execution logic to adapt to
> problems with hanging grandchild processes on Windows.  This changes
> have a side-effect (which we cannot seem to avoid) that causes any
> forked process to use up at least about half a second.  With 1.8.1 the
> same logic changes have been applied to other OSes as well.
>
> So if you build process was forking a lot of small processes, a major
> slowdown is to be expected.
>
> > We're running junit with fork=yes and forkmode=once.
>
> forkmode="once" should just create a single new process and you'd only
> be paying the overhead once - not for each test.  This is the first
> thing I'd look into, makesure there really only is a single VM forked.
>
> > For the curious, I've created a simplified project here:
> > http://web.mit.edu/lgdean/Public/test-project.zip .
>
> I'll look into it.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: junit tests running slower in 1.8 than in 1.7

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-07-22, Laura Dean wrote:

> My team has a unit test suite that ran in about a minute and a half
> with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
> 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
> found via google is here, but it doesn't shed much light on the
> subject:

> http://netbeans.org/bugzilla/show_bug.cgi?id=182263

Ant 1.8.0 changed some parts of the process execution logic to adapt to
problems with hanging grandchild processes on Windows.  This changes
have a side-effect (which we cannot seem to avoid) that causes any
forked process to use up at least about half a second.  With 1.8.1 the
same logic changes have been applied to other OSes as well.

So if you build process was forking a lot of small processes, a major
slowdown is to be expected.

> We're running junit with fork=yes and forkmode=once.

forkmode="once" should just create a single new process and you'd only
be paying the overhead once - not for each test.  This is the first
thing I'd look into, makesure there really only is a single VM forked.

> For the curious, I've created a simplified project here:
> http://web.mit.edu/lgdean/Public/test-project.zip .

I'll look into it.

Stefan

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


Re: junit tests running slower in 1.8 than in 1.7

Posted by Laura Dean <lg...@cyrusinnovation.com>.
On Wed, Jul 21, 2010 at 7:26 PM, Martin Gainty <mg...@hotmail.com> wrote:
>
> what processor have you implemented in your testbed platform?

On this particular machine, windows reports:
Intel(R) Core(TM) i7 CPU   940 @ 2.93 GHz

> how much ram on your testbed platform?

6 GB

We've seen the same behavior on our less powerful machines, though.


So it looks like, on your machine, taking out fork=yes doesn't result
in any speedup.  Do you also find that switching down to ant 1.7.1
doesn't make a difference?

Merci / vielen Dank,

Laura

>
>
> //With fork:
>
> \ANT\apache-ant-1.8.0\apps\test-project>ant test
> Buildfile: build.xml
>
> test:
>    [junit] Testsuite: SomeJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.203 sec
>    [junit]
>    [junit] Testsuite: SomeOtherJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.157 sec
>    [junit]
>    [junit] Testsuite: YetAnotherJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.157 sec
>    [junit]
>
> ActualTotal=.517s
>
> BUILD SUCCESSFUL
>
> Total time: 2 seconds
>
>
>
> //without fork
> \ANT\apache-ant-1.8.0\apps\test-project>ant test
> Buildfile: build.xml
>
> test:
>    [junit] Testsuite: SomeJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.204 sec
>    [junit]
>    [junit] Testsuite: SomeOtherJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.156 sec
>    [junit]
>    [junit] Testsuite: YetAnotherJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.157 sec
>    [junit]
>
> ActualTotal=.517s
>
> BUILD SUCCESSFUL
> Total time: 1 second
> E:\ANT\apache-ant-1.8.0\apps\test-project>without fork
>
>
> apparently Total time display is inaccurate
>
>
>
> ?
>
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>

>
>> Date: Wed, 21 Jul 2010 18:33:14 -0400
>> Subject: junit tests running slower in 1.8 than in 1.7
>> From: lgdean@cyrusinnovation.com
>> To: user@ant.apache.org
>>
>> My team has a unit test suite that ran in about a minute and a half
>> with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
>> 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
>> found via google is here, but it doesn't shed much light on the
>> subject:
>>
>> http://netbeans.org/bugzilla/show_bug.cgi?id=182263
>>
>> We're running junit with fork=yes and forkmode=once.  With forking
>> turned off, the tests run much faster, about the same as in 1.7.  (But
>> we want the forking for other reasons.)
>>
>> We're running under Windows, with jdk 1.6 and junit 4.5.
>>
>> Have you seen this problem and worked around it?  Is it a known issue,
>> or a problem with our configuration?
>>
>> For the curious, I've created a simplified project here:
>> http://web.mit.edu/lgdean/Public/test-project.zip .  I've also
>> attached test results below, showing the difference (with much smaller
>> numbers), and a snippet of the build.xml file.  Any advice would be
>> appreciated.
>>
>> Thanks,
>>
>> Laura
>>
>>
>>
>> C:\ant-trouble\my-project>ant -version
>> Apache Ant version 1.7.1 compiled on June 27 2008
>> C:\ant-trouble\my-project>ant test
>>
>> test:
>>     [junit] Testsuite: SomeJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.042 sec
>>     [junit]
>>     [junit] Testsuite: SomeOtherJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.032 sec
>>     [junit]
>>     [junit] Testsuite: YetAnotherJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.034 sec
>>     [junit]
>>
>>
>> C:\ant-trouble\my-project>ant -version
>> Apache Ant version 1.8.1 compiled on April 30 2010
>> C:\ant-trouble\my-project>ant test
>>
>> test:
>>     [junit] Testsuite: SomeJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.044 sec
>>     [junit]
>>     [junit] Testsuite: SomeOtherJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.122 sec
>>     [junit]
>>     [junit] Testsuite: YetAnotherJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.108 sec
>>     [junit]

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


RE: junit tests running slower in 1.8 than in 1.7

Posted by Martin Gainty <mg...@hotmail.com>.
what processor have you implemented in your testbed platform?

how much ram on your testbed platform?

 

//With fork:

\ANT\apache-ant-1.8.0\apps\test-project>ant test
Buildfile: build.xml

test:
    [junit] Testsuite: SomeJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.203 sec
    [junit]
    [junit] Testsuite: SomeOtherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.157 sec
    [junit]
    [junit] Testsuite: YetAnotherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.157 sec
    [junit]

ActualTotal=.517s

BUILD SUCCESSFUL

Total time: 2 seconds

 

//without fork
\ANT\apache-ant-1.8.0\apps\test-project>ant test
Buildfile: build.xml

test:
    [junit] Testsuite: SomeJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.204 sec
    [junit]
    [junit] Testsuite: SomeOtherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.156 sec
    [junit]
    [junit] Testsuite: YetAnotherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.157 sec
    [junit]

ActualTotal=.517s

BUILD SUCCESSFUL
Total time: 1 second
E:\ANT\apache-ant-1.8.0\apps\test-project>without fork


apparently Total time display is inaccurate

 

?

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> Date: Wed, 21 Jul 2010 18:33:14 -0400
> Subject: junit tests running slower in 1.8 than in 1.7
> From: lgdean@cyrusinnovation.com
> To: user@ant.apache.org
> 
> My team has a unit test suite that ran in about a minute and a half
> with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
> 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
> found via google is here, but it doesn't shed much light on the
> subject:
> 
> http://netbeans.org/bugzilla/show_bug.cgi?id=182263
> 
> We're running junit with fork=yes and forkmode=once.  With forking
> turned off, the tests run much faster, about the same as in 1.7.  (But
> we want the forking for other reasons.)
> 
> We're running under Windows, with jdk 1.6 and junit 4.5.
> 
> Have you seen this problem and worked around it?  Is it a known issue,
> or a problem with our configuration?
> 
> For the curious, I've created a simplified project here:
> http://web.mit.edu/lgdean/Public/test-project.zip .  I've also
> attached test results below, showing the difference (with much smaller
> numbers), and a snippet of the build.xml file.  Any advice would be
> appreciated.
> 
> Thanks,
> 
> Laura
> 
> 
> 
> C:\ant-trouble\my-project>ant -version
> Apache Ant version 1.7.1 compiled on June 27 2008
> C:\ant-trouble\my-project>ant test
> 
> test:
>     [junit] Testsuite: SomeJUnitTest
>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.042 sec
>     [junit]
>     [junit] Testsuite: SomeOtherJUnitTest
>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.032 sec
>     [junit]
>     [junit] Testsuite: YetAnotherJUnitTest
>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.034 sec
>     [junit]
> 
> 
> C:\ant-trouble\my-project>ant -version
> Apache Ant version 1.8.1 compiled on April 30 2010
> C:\ant-trouble\my-project>ant test
> 
> test:
>     [junit] Testsuite: SomeJUnitTest
>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.044 sec
>     [junit]
>     [junit] Testsuite: SomeOtherJUnitTest
>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.122 sec
>     [junit]
>     [junit] Testsuite: YetAnotherJUnitTest
>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.108 sec
>     [junit]
> 
> 
> <target name="test">
> <junit fork="yes" forkmode="once">
> <formatter type="brief" usefile="false"/>
> <classpath> [...] </classpath>
> <batchtest>
> <fileset dir=".">
> <include name="**/*Test.java"/>
> </fileset>
> </batchtest>
> </junit>
> </target>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
 		 	   		  
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2