You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Carl Trieloff <cc...@redhat.com> on 2006/12/07 23:33:50 UTC

[Fwd: [java] Test result inconsistencies?]

Kim sent to wrong list ---- forwarding
Carl.

--------------

I notice that about half the time the maven tests hang. Consecutive runs 
either pass or hang (which I have to terminate). I make no other changes 
from run to run - I just run "mvn". Sometimes consecutive runs pass, 
hang, pass, hang, etc. but not always.

Is is possible that there is some sort of left-over 
state/condition/file/process that may be interfering with tests? I 
searched for running brokers, etc., but I did not see anything.

When it works, I get the normal test passed message.  When it hangs I 
get (always the same message):

<snip>
Running org.apache.qpid.test.unit.client.forwardall.CombinedTest
Starting 2 services...
Starting client...
Received 1 of 2 responses.
<hang>

Other times, where I got completely normal results on previous runs, 
several tests produce error messages, but the test still passes. When 
this happens (about 1 run in 5 or 6), I get:

<snip>
Running org.apache.qpid.test.unit.client.channelclose.ChannelCloseOkTest
pool-16-thread-4 2006-12-07 16:27:03,633 ERROR [qpid.server.protocol.AMQPFastProtocolHandler] Exception caught inAMQProtocolSession(anonymous(7912507)), closing session explictly: java.lang.IllegalStateException: Handed undecoded ByteBuffer buf = HeapBuffer[pos=0 lim=0 cap=0: empty]
java.lang.IllegalStateException: Handed undecoded ByteBuffer buf = HeapBuffer[pos=0 lim=0 cap=0: empty]
        at org.apache.qpid.server.protocol.AMQPFastProtocolHandler.messageReceived(AMQPFastProtocolHandler.java:198)
        at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(AbstractIoFilterChain.java:189)
        at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:502)
        at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:52)
        at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:777)
        at org.apache.qpid.pool.Event.process(Event.java:80)
        at org.apache.qpid.pool.Job.processAll(Job.java:81)
        at org.apache.qpid.pool.Job.run(Job.java:103)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
<repeated several times>
>>>>>>>>>>>>>>.. closing
<snip>

but continues to a successful pass message.

Not being active on the java side for a little while, these may be 
development-in-progress errors, or they may be tests interacting with 
each other in some way. I hope I am not raising a well-known issue or a 
red herring... However, my "red flag" is based on the idea that 
consecutive tests under otherwise identical conditions should produce 
identical results.

Ideas?

Kim


Re: [Fwd: [java] Test result inconsistencies?]

Posted by Steve Vinoski <vi...@iona.com>.
On Dec 8, 2006, at 12:24 PM, Rajith Attapattu wrote:

> I have seen this behavior (what Kim described), most of the time it  
> hangs
> and sometimes it will fail.
> If we can move all the integration type of tests outside the code  
> base then
> we want have this problem.
>
> This sort of inconsistent behavior has forced me to skip the tests  
> using -
> Dmaven.test.skip most of the time which is not a good practice.
> Can we have only unit tests as part of the main build, and perhapse a
> different goal (or phase if thats the right terminology) to run the
> integration tests.
>
> For unit tests it's illegal by definition to make connections (in  
> VM or
> otherwise), to have threads blocking for messages/requests/reponses  
> or chain
> tests together etc.
> If we need to test connections or request/response scenario as part  
> of the
> main build then lets use mock objects (EasyMock or whatever) and  
> lets move
> the other stuff to systests.

A big +1. I've mentioned several times the need for more test  
reorganization. And I strongly recommend Easymock for unit testing,  
it's really nice and quite powerful.

> Also, Steve can we use a code coverage tool with maven ? I suspect  
> that we
> have very little unit test coverage and more integration type of  
> tests.

Sure, just type

mvn cobertura:cobertura

In both Spanish and Portuguese, "cobertura" means "coverage." Running  
this will generate HTML reports about unit test coverage, which as  
you've correctly guessed, is quite low.

--steve

Re: [Fwd: [java] Test result inconsistencies?]

Posted by Rajith Attapattu <ra...@gmail.com>.
I have seen this behavior (what Kim described), most of the time it hangs
and sometimes it will fail.
If we can move all the integration type of tests outside the code base then
we want have this problem.

This sort of inconsistent behavior has forced me to skip the tests using -
Dmaven.test.skip most of the time which is not a good practice.
Can we have only unit tests as part of the main build, and perhapse a
different goal (or phase if thats the right terminology) to run the
integration tests.

For unit tests it's illegal by definition to make connections (in VM or
otherwise), to have threads blocking for messages/requests/reponses or chain
tests together etc.
If we need to test connections or request/response scenario as part of the
main build then lets use mock objects (EasyMock or whatever) and lets move
the other stuff to systests.

Also, Steve can we use a code coverage tool with maven ? I suspect that we
have very little unit test coverage and more integration type of tests.

Regards,

Rajith


On 12/8/06, Steve Vinoski <vi...@iona.com> wrote:
>
>
> On Dec 8, 2006, at 7:49 AM, Kim van der Riet wrote:
>
> > On Fri, 2006-12-08 at 00:45 -0500, Steve Vinoski wrote:
> >>> When it works, I get the normal test passed message.  When it hangs
> >>> I get (always the same message):
> >>>
> >>> <snip>
> >>> Running org.apache.qpid.test.unit.client.forwardall.CombinedTest
> >>> Starting 2 services...
> >>> Starting client...
> >>> Received 1 of 2 responses.
> >>> <hang>
> >>
> >> I personally have never seen this problem. Why not try jacking up the
> >> verbosity of the test output to see if you can narrow down where it's
> >> hanging?
> > How is this done? I looked at the command line options with mvn --
> > help;
> > there is no verbose option. Neither is there a man page. A quick scan
> > through the on-line docs did not reveal anything about verbosity...
> > (although it was a very quick scan!) Is this done through editing the
> > settings.xml file, perhaps?
>
> Hi Kim,
>
> Unfortunately the log4j logging level was hard-coded in the client
> pom.xml. If you svn update that pom, you can now run
>
> mvn -Dtest=CombinedTest -Damqj.logging.level=debug test
>
> to get full debug output.
>
> --steve
>

Re: [Fwd: [java] Test result inconsistencies?]

Posted by Steve Vinoski <vi...@iona.com>.
On Dec 8, 2006, at 7:49 AM, Kim van der Riet wrote:

> On Fri, 2006-12-08 at 00:45 -0500, Steve Vinoski wrote:
>>> When it works, I get the normal test passed message.  When it hangs
>>> I get (always the same message):
>>>
>>> <snip>
>>> Running org.apache.qpid.test.unit.client.forwardall.CombinedTest
>>> Starting 2 services...
>>> Starting client...
>>> Received 1 of 2 responses.
>>> <hang>
>>
>> I personally have never seen this problem. Why not try jacking up the
>> verbosity of the test output to see if you can narrow down where it's
>> hanging?
> How is this done? I looked at the command line options with mvn -- 
> help;
> there is no verbose option. Neither is there a man page. A quick scan
> through the on-line docs did not reveal anything about verbosity...
> (although it was a very quick scan!) Is this done through editing the
> settings.xml file, perhaps?

Hi Kim,

Unfortunately the log4j logging level was hard-coded in the client  
pom.xml. If you svn update that pom, you can now run

mvn -Dtest=CombinedTest -Damqj.logging.level=debug test

to get full debug output.

--steve

Re: [Fwd: [java] Test result inconsistencies?]

Posted by Kim van der Riet <ki...@redhat.com>.
On Fri, 2006-12-08 at 00:45 -0500, Steve Vinoski wrote:
> > When it works, I get the normal test passed message.  When it hangs  
> > I get (always the same message):
> >
> > <snip>
> > Running org.apache.qpid.test.unit.client.forwardall.CombinedTest
> > Starting 2 services...
> > Starting client...
> > Received 1 of 2 responses.
> > <hang>
> 
> I personally have never seen this problem. Why not try jacking up the  
> verbosity of the test output to see if you can narrow down where it's  
> hanging?
How is this done? I looked at the command line options with mvn --help;
there is no verbose option. Neither is there a man page. A quick scan
through the on-line docs did not reveal anything about verbosity...
(although it was a very quick scan!) Is this done through editing the
settings.xml file, perhaps?

> 
> BTW, to run just this single test, and assuming what you need from  
> common and broker are already available/built, you can
> 
> cd client
> mvn -Dtest=CombinedTest test
Thanks, this shortens the cycle. CombinedTest still hangs about one run
in three if I run it this way consecutively. I cannot get either
ChannelCloseOkTest or ConnectionURLTest to produce errors when run on
their own.

Kim


Re: [Fwd: [java] Test result inconsistencies?]

Posted by Steve Vinoski <vi...@iona.com>.
On Dec 7, 2006, at 5:33 PM, Carl Trieloff wrote:

>
> Kim sent to wrong list ---- forwarding
> Carl.
>
> --------------
>
> I notice that about half the time the maven tests hang. Consecutive  
> runs either pass or hang (which I have to terminate). I make no  
> other changes from run to run - I just run "mvn". Sometimes  
> consecutive runs pass, hang, pass, hang, etc. but not always.
>
> Is is possible that there is some sort of left-over state/condition/ 
> file/process that may be interfering with tests? I searched for  
> running brokers, etc., but I did not see anything.
>
> When it works, I get the normal test passed message.  When it hangs  
> I get (always the same message):
>
> <snip>
> Running org.apache.qpid.test.unit.client.forwardall.CombinedTest
> Starting 2 services...
> Starting client...
> Received 1 of 2 responses.
> <hang>

I personally have never seen this problem. Why not try jacking up the  
verbosity of the test output to see if you can narrow down where it's  
hanging?

BTW, to run just this single test, and assuming what you need from  
common and broker are already available/built, you can

cd client
mvn -Dtest=CombinedTest test

> Other times, where I got completely normal results on previous  
> runs, several tests produce error messages, but the test still  
> passes. When this happens (about 1 run in 5 or 6), I get:
>
> <snip>
> Running  
> org.apache.qpid.test.unit.client.channelclose.ChannelCloseOkTest
> pool-16-thread-4 2006-12-07 16:27:03,633 ERROR  
> [qpid.server.protocol.AMQPFastProtocolHandler] Exception caught  
> inAMQProtocolSession(anonymous(7912507)), closing session  
> explictly: java.lang.IllegalStateException: Handed undecoded  
> ByteBuffer buf = HeapBuffer[pos=0 lim=0 cap=0: empty]
> java.lang.IllegalStateException: Handed undecoded ByteBuffer buf =  
> HeapBuffer[pos=0 lim=0 cap=0: empty]

I've seen this too, though not recently.

--steve