You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mikhail Loenko <ml...@gmail.com> on 2006/06/01 16:23:37 UTC

[classlib] [testing] 37% of total test execution time is spent in a single test

There is a test

tests.api.java.net.Inet6AddressTest.test_getByNameLjava_lang_String

that iterates over arrays of valid ip adresses (array.length = 11) and
invalid ones (length=4). The test expects exception in invalid cases
and some reasonable behavior in valid ones. The test takes more
then 1/3 of the whole test suite execution time.

Host resolution goes to a native code and seems to end inside OS
(Windows in my case). As it was noticed in the "millions of rmi tests"
thread it is not necessary to iterate through a huge set of possible values
when a method just passes argument to a different method.

I think that some of the values could be deleted from the array and replaced
with duplicates of some existing entries (to exercise both positive and negative
caching). I they could then we will reduce test execution time by ~30%

Thoughts?

Thanks,
Mikhail

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib] [testing] 37% of total test execution time is spent in a single test

Posted by Mikhail Loenko <ml...@gmail.com>.
If that reason is detected in the OS, not in our code, why does it
make difference?

Do you mean that we should not just test our code but also make
sure it works well in any environment (including OS)? I'd buy that
but think in this case it is not a unit test and thus should be moved
to a separate suite.

Thanks,
Mikhail

2006/6/9, Santiago Gala <sg...@apache.org>:
> El jue, 01-06-2006 a las 22:26 +0700, Mikhail Loenko escribió:
> > 2006/6/1, Geir Magnusson Jr <ge...@pobox.com>:
> > >
> > >
> > > Mikhail Loenko wrote:
> > > > 2006/6/1, Geir Magnusson Jr <ge...@pobox.com>:
> > > >>
> > > >> I don't quite grok what you mean - could you post what you are
> > > >> suggesting in code here on -dev?
> > > >
> > > >
> > > > Index: modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> > > > ===================================================================
> > > > ---
> > > > modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> > > > (revision
> > > > 410480)
> > > > +++
> > > > modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> > > > (working
> > > > copy)
> > > > @@ -785,7 +785,7 @@
> > > >                 "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:255.255.255.255",
> > > >                 "0:0:0:0:0:0:0:0", "0:0:0:0:0:0:0.0.0.0" };
> > > >
> > > > -        String invalidIPAddresses[] = { ":", "FFFF:FFFF", "1:1",
> > > > "::1.2.3.444" };
>
> Not the code author, but the last address is illegal for a different
> reason to the others, specifically because 444>255 and only because of
> this.
>
> Regards
> Santiago
>
> > > > +        String invalidIPAddresses[] = { "FFFF:FFFF" };
> > > >
> > > >         for (int i = 0; i < validIPAddresses.length; i++) {
> > > >
> > > >
> > >
> > > Thx - why do you want to remove testing the others?  Because you believe
> > > that it is in effect testing the resolver in the OS since each returns
> > > the same answer,and thus it's testing the same thing over and over?
> >
> > I believe so, but I'd like to hear confirmation from code authors
> >
> > Thanks,
> > Mikhail
> >
> >
> > >
> > > If so, I agree with you.
> > >
> > > If not, I still don't grok the point :)
> > >
> > > geir
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> --
> VP and Chair, Apache Portals (http://portals.apache.org)
> Apache Software Foundation
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (GNU/Linux)
>
> iD8DBQBEiGiRZAeG2a2/nhoRAhEQAKCh2XU75nmRtUY75I0faZu9a6/M4QCggaJX
> JayynGPTdwg8+3NAp1DnPKk=
> =ZwHY
> -----END PGP SIGNATURE-----
>
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib] [testing] 37% of total test execution time is spent in a single test

Posted by Santiago Gala <sg...@apache.org>.
El jue, 01-06-2006 a las 22:26 +0700, Mikhail Loenko escribió:
> 2006/6/1, Geir Magnusson Jr <ge...@pobox.com>:
> >
> >
> > Mikhail Loenko wrote:
> > > 2006/6/1, Geir Magnusson Jr <ge...@pobox.com>:
> > >>
> > >> I don't quite grok what you mean - could you post what you are
> > >> suggesting in code here on -dev?
> > >
> > >
> > > Index: modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> > > ===================================================================
> > > ---
> > > modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> > > (revision
> > > 410480)
> > > +++
> > > modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> > > (working
> > > copy)
> > > @@ -785,7 +785,7 @@
> > >                 "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:255.255.255.255",
> > >                 "0:0:0:0:0:0:0:0", "0:0:0:0:0:0:0.0.0.0" };
> > >
> > > -        String invalidIPAddresses[] = { ":", "FFFF:FFFF", "1:1",
> > > "::1.2.3.444" };

Not the code author, but the last address is illegal for a different
reason to the others, specifically because 444>255 and only because of
this.

Regards
Santiago

> > > +        String invalidIPAddresses[] = { "FFFF:FFFF" };
> > >
> > >         for (int i = 0; i < validIPAddresses.length; i++) {
> > >
> > >
> >
> > Thx - why do you want to remove testing the others?  Because you believe
> > that it is in effect testing the resolver in the OS since each returns
> > the same answer,and thus it's testing the same thing over and over?
> 
> I believe so, but I'd like to hear confirmation from code authors
> 
> Thanks,
> Mikhail
> 
> 
> >
> > If so, I agree with you.
> >
> > If not, I still don't grok the point :)
> >
> > geir
> >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 
-- 
VP and Chair, Apache Portals (http://portals.apache.org)
Apache Software Foundation

Re: [classlib] [testing] 37% of total test execution time is spent in a single test

Posted by Mikhail Loenko <ml...@gmail.com>.
2006/6/1, Geir Magnusson Jr <ge...@pobox.com>:
>
>
> Mikhail Loenko wrote:
> > 2006/6/1, Geir Magnusson Jr <ge...@pobox.com>:
> >>
> >> I don't quite grok what you mean - could you post what you are
> >> suggesting in code here on -dev?
> >
> >
> > Index: modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> > ===================================================================
> > ---
> > modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> > (revision
> > 410480)
> > +++
> > modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> > (working
> > copy)
> > @@ -785,7 +785,7 @@
> >                 "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:255.255.255.255",
> >                 "0:0:0:0:0:0:0:0", "0:0:0:0:0:0:0.0.0.0" };
> >
> > -        String invalidIPAddresses[] = { ":", "FFFF:FFFF", "1:1",
> > "::1.2.3.444" };
> > +        String invalidIPAddresses[] = { "FFFF:FFFF" };
> >
> >         for (int i = 0; i < validIPAddresses.length; i++) {
> >
> >
>
> Thx - why do you want to remove testing the others?  Because you believe
> that it is in effect testing the resolver in the OS since each returns
> the same answer,and thus it's testing the same thing over and over?

I believe so, but I'd like to hear confirmation from code authors

Thanks,
Mikhail


>
> If so, I agree with you.
>
> If not, I still don't grok the point :)
>
> geir
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib] [testing] 37% of total test execution time is spent in a single test

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Mikhail Loenko wrote:
> 2006/6/1, Geir Magnusson Jr <ge...@pobox.com>:
>>
>> I don't quite grok what you mean - could you post what you are
>> suggesting in code here on -dev?
> 
> 
> Index: modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
> ===================================================================
> ---
> modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java   
> (revision
> 410480)
> +++
> modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java   
> (working
> copy)
> @@ -785,7 +785,7 @@
>                 "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:255.255.255.255",
>                 "0:0:0:0:0:0:0:0", "0:0:0:0:0:0:0.0.0.0" };
> 
> -        String invalidIPAddresses[] = { ":", "FFFF:FFFF", "1:1",
> "::1.2.3.444" };
> +        String invalidIPAddresses[] = { "FFFF:FFFF" };
> 
>         for (int i = 0; i < validIPAddresses.length; i++) {
> 
> 

Thx - why do you want to remove testing the others?  Because you believe
that it is in effect testing the resolver in the OS since each returns
the same answer,and thus it's testing the same thing over and over?

If so, I agree with you.

If not, I still don't grok the point :)

geir


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib] [testing] 37% of total test execution time is spent in a single test

Posted by Mikhail Loenko <ml...@gmail.com>.
2006/6/1, Geir Magnusson Jr <ge...@pobox.com>:
>
>
> Mikhail Loenko wrote:
> > There is a test
> >
> > tests.api.java.net.Inet6AddressTest.test_getByNameLjava_lang_String
>
> Nice package name.  That's the first thing to be fixed :)
>
> >
> > that iterates over arrays of valid ip adresses (array.length = 11) and
> > invalid ones (length=4). The test expects exception in invalid cases
> > and some reasonable behavior in valid ones. The test takes more
> > then 1/3 of the whole test suite execution time.
> >
> > Host resolution goes to a native code and seems to end inside OS
> > (Windows in my case). As it was noticed in the "millions of rmi tests"
> > thread it is not necessary to iterate through a huge set of possible values
> > when a method just passes argument to a different method.
> >
> > I think that some of the values could be deleted from the array and
> > replaced
> > with duplicates of some existing entries (to exercise both positive and
> > negative
> > caching). I they could then we will reduce test execution time by ~30%
> >
> > Thoughts?
>
> I don't quite grok what you mean - could you post what you are
> suggesting in code here on -dev?


Index: modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java
===================================================================
--- modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java	(revision
410480)
+++ modules/luni/src/test/java/tests/api/java/net/Inet6AddressTest.java	(working
copy)
@@ -785,7 +785,7 @@
 				"FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:255.255.255.255",
 				"0:0:0:0:0:0:0:0", "0:0:0:0:0:0:0.0.0.0" };

-		String invalidIPAddresses[] = { ":", "FFFF:FFFF", "1:1", "::1.2.3.444" };
+		String invalidIPAddresses[] = { "FFFF:FFFF" };

 		for (int i = 0; i < validIPAddresses.length; i++) {




>
> geir
>
> >
> > Thanks,
> > Mikhail
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib] [testing] 37% of total test execution time is spent in a single test

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Mikhail Loenko wrote:
> There is a test
> 
> tests.api.java.net.Inet6AddressTest.test_getByNameLjava_lang_String

Nice package name.  That's the first thing to be fixed :)

> 
> that iterates over arrays of valid ip adresses (array.length = 11) and
> invalid ones (length=4). The test expects exception in invalid cases
> and some reasonable behavior in valid ones. The test takes more
> then 1/3 of the whole test suite execution time.
> 
> Host resolution goes to a native code and seems to end inside OS
> (Windows in my case). As it was noticed in the "millions of rmi tests"
> thread it is not necessary to iterate through a huge set of possible values
> when a method just passes argument to a different method.
> 
> I think that some of the values could be deleted from the array and
> replaced
> with duplicates of some existing entries (to exercise both positive and
> negative
> caching). I they could then we will reduce test execution time by ~30%
> 
> Thoughts?

I don't quite grok what you mean - could you post what you are
suggesting in code here on -dev?

geir

> 
> Thanks,
> Mikhail
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org