harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Fedotov" <alexei.fedo...@gmail.com>
Subject Re: [general][tests]To restrict the side-effect of junit tests by launching it in a different VM.
Date Tue, 28 Nov 2006 07:09:34 GMT
Leo,

If I understood you correctly you suggested running all test cases in
separate JVMs. Yes, I agree that this would improve execution
statistics. This can be done right now using a special property
${hy.test.forkmode} added by Vladimir and Mikhail.

>From the other side a user who is running a real application cannot be
advised to launch few next methods in the fresh JVM. That is why JVM,
especially a server JVM, should handle long execution without changing
its global state to inconsistent one.

I personally prefer to add a proper cleanup for all tests and maintain
their ability to run in a single JVM in a way a conventional JUnit
semantics assumes. This would serve as a simplest reliability load for
Harmony, and we, executing tests each day while testing our patches
will maintain reliability level of Harmony on some level. Running
tests in one JVM also gives us a small but nice benefit of speeding up
the test execution.

I could imagine some negative JNI tests which can be impossible to
recover from, and my suggestion does not apply to such tests.

-- 
Thank you,
Alexei


On 11/27/06, Leo Li <liyilei1979@gmail.com> wrote:
>  Yes, in some special cases. Both RI and Harmony adopt some cache mechanism
> in resolving class in ObjectInputStream.
>
> On 11/27/06, Geir Magnusson Jr. <geir@pobox.com> wrote:
> >
> > Right - I guess the ambiguity for me is if the side effect was correct
> > behavior or not - we're using this "run all in one VM" mode in DRLVM
> > tests to find harmful side effects...
> >
> > geir
> >
> > Mikhail Loenko wrote:
> > > When you changed the test case to avoid side-effect have you made the
> > test
> > > weaker? If not I'd prefer to run them in a fork mode "once" because in
> > this
> > > case they run faster.
> > >
> > > Thanks,
> > > Mikhail
> > >
> > > 2006/11/27, Leo Li <liyilei1979@gmail.com>:
> > >> Hi, all:
> > >>     During fixing the bug of Harmony-2249, I found that the testcase
> > >> in one
> > >> junit test file might lead to other fail in a different junit file.
> > After
> > >> digging into it, I am aware that testcase can influence the global
> > >> state of
> > >> a VM, for example, the resolution of class (both RI and Harmony have
> > >> similar
> > >> behavior). Although I changed the testcase as a workaround,  it is not
> > >> tested so thoroughly as I expected in order not to lead other tests to
> > >> fail.
> > >>
> > >>    So I recommend if we can specify some testcase that should run in
> > >> junit
> > >> with fork = "true". Maybe to add some annotation is one resolution or
> > >> to add
> > >> them to a property file as we done with excluded ones.
> > >>    Any suggestion?
> > >>
> > >> --
> > >> Leo Li
> > >> China Software Development Lab, IBM
> > >>
> > >>
> >
>
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>

Mime
View raw message