You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Chris Harris <ry...@gmail.com> on 2009/09/04 19:35:32 UTC

Efficiently running a single test class' tests?

I gather that you can run the tests from a single test class by
specifying that class's name like so:

    ant test -Dtestcase=ShingleFilterTest

This saves time over doing "ant test" without the testcase argument,
but it's still not at all fast on my machine. To be more specific, I
tried the following:

 * download a fresh Lucene r811157
 * run "ant test -Dtestcase=ShingleFilterTest" a first time, to make
sure everything required to run this test gets built
 * run "ant test -Dtestcase=ShingleFilterTest" a second time, to see
how long running the single test takes once everything is built

This second invocation to ant took 7 minutes, 8 seconds for ant to
finish. Most of the time was obviously not spent running the
ShingleFilterTest itself. According to the
TEST-org.apache.lucene.analysis.shingle.ShingleFilterTest.xml output
file, running that particular class took only

    time="0.578"

which I assume is in seconds. So the great bulk of the "ant test"
seems to be spent in various ant housecleaning tasks, trying to verify
that everything is indeed built, and/or looking for test classes that
might match the name "ShingleFilterTest".

I tried running

    ant test-contrib -Dtestcase=ShingleFilterTest

to see if limiting to contrib would be any faster. That came back in 5
minutes, 27 seconds. Which is better, but still in the same ballpark.

Is this the sort of time other people see when running a single test
through ant? What alternatives are there if you want to be able to run
a given test really fast -- say, after a 10 second delay, rather than
a 5 minute delay? Does this become trivial once you set up Lucene
properly in an IDE? Any quick command-line techniques?

Thanks,
Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: Efficiently running a single test class' tests?

Posted by Mark Miller <ma...@gmail.com>.
That's some weird stuff - I've never seen a test take anywhere near  
that long (run single or not) - on my machine there are a couple that  
take a minute at most, but the majority are sub second to a couple  
seconds.

- Mark

http://www.lucidimagination.com (mobile)

On Sep 4, 2009, at 1:35 PM, Chris Harris <ry...@gmail.com> wrote:

> I gather that you can run the tests from a single test class by
> specifying that class's name like so:
>
>    ant test -Dtestcase=ShingleFilterTest
>
> This saves time over doing "ant test" without the testcase argument,
> but it's still not at all fast on my machine. To be more specific, I
> tried the following:
>
> * download a fresh Lucene r811157
> * run "ant test -Dtestcase=ShingleFilterTest" a first time, to make
> sure everything required to run this test gets built
> * run "ant test -Dtestcase=ShingleFilterTest" a second time, to see
> how long running the single test takes once everything is built
>
> This second invocation to ant took 7 minutes, 8 seconds for ant to
> finish. Most of the time was obviously not spent running the
> ShingleFilterTest itself. According to the
> TEST-org.apache.lucene.analysis.shingle.ShingleFilterTest.xml output
> file, running that particular class took only
>
>    time="0.578"
>
> which I assume is in seconds. So the great bulk of the "ant test"
> seems to be spent in various ant housecleaning tasks, trying to verify
> that everything is indeed built, and/or looking for test classes that
> might match the name "ShingleFilterTest".
>
> I tried running
>
>    ant test-contrib -Dtestcase=ShingleFilterTest
>
> to see if limiting to contrib would be any faster. That came back in 5
> minutes, 27 seconds. Which is better, but still in the same ballpark.
>
> Is this the sort of time other people see when running a single test
> through ant? What alternatives are there if you want to be able to run
> a given test really fast -- say, after a 10 second delay, rather than
> a 5 minute delay? Does this become trivial once you set up Lucene
> properly in an IDE? Any quick command-line techniques?
>
> Thanks,
> Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: Efficiently running a single test class' tests?

Posted by Chris Hostetter <ho...@fucit.org>.
: which I assume is in seconds. So the great bulk of the "ant test"
: seems to be spent in various ant housecleaning tasks, trying to verify
: that everything is indeed built, and/or looking for test classes that
: might match the name "ShingleFilterTest".

Bear in mind, each contrib is built/tested seperately, so it's not just 
looking for every test that might match the pattern, it's iterating over 
each contrib and checking them all for a test that matches.

: I tried running
: 
:     ant test-contrib -Dtestcase=ShingleFilterTest
: 
: to see if limiting to contrib would be any faster. That came back in 5
: minutes, 27 seconds. Which is better, but still in the same ballpark.

what kind of machine are you using? ... because on my box that only takes 
about 40 seconds.

if you are working on a contrib, and want to just run tests in that 
contrib, switching to that working directory and running the targets there 
is always going to be faster...

hossman@brunner:~/lucene/java$ time ant test-contrib -Dtestcase=ShingleFilterTest > tmp.out

real    0m32.142s
user    0m17.744s
sys     0m8.074s
hossman@brunner:~/lucene/java$ cd contrib/analyzers/
hossman@brunner:~/lucene/java/contrib/analyzers$ time ant test -Dtestcase=ShingleFilterTest > ../../tmp-contrib.out

real    0m2.450s
user    0m1.644s
sys     0m0.664s

-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org