You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Jonathan Anstey <ja...@iona.com> on 2007/01/26 19:57:24 UTC

Re: svn commit: r500264 - /incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java

Hi,

This particular commit caused the testAcknowledgePerConsumer test to 
fail in org.apache.qpid.test.unit.ack.RecoverTest. For some reason it 
seems that queue1 in TransactedTest.java lingers around after the test 
has completed. In RecoverTest.java, the same queue is picked up and 
causes the following error to occur:

testAcknowledgePerConsumer(org.apache.qpid.test.unit.ack.RecoverTest)  
Time elapsed: 0.037 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<msg1> but was:<A>
        at junit.framework.Assert.assertEquals(Assert.java:81)
        at junit.framework.Assert.assertEquals(Assert.java:87)
        at 
org.apache.qpid.test.unit.ack.RecoverTest.testAcknowledgePerConsumer(RecoverTest.java:204)

The message "A" comes from queue1 in TransactedTest.java.  I have 
attached a patch for TransactedTest.java to fix this problem. My fix 
basically setup queue1 to auto delete so it won't be around for the 
other tests.

Cheers,
Jon


kpvdr@apache.org wrote:
> Author: kpvdr
> Date: Fri Jan 26 06:50:16 2007
> New Revision: 500264
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=500264
> Log:
> Change to TransactedTest which prevents the intermittent error junit.framework.ComparisonFailure: expected:<B> but was:<C> (or similar) from occurring on either the commit or rollback portion of the test. The error occurs when the test consumer testConsumer1 bind frames arrive at the server before the message bodies with A,B,C and cause queue 1 to start a round-robin distribution for these messages when they finally do arrive.
>
> Modified:
>     incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
>
> Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
> URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java?view=diff&rev=500264&r1=500263&r2=500264
> ==============================================================================
> --- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java (original)
> +++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java Fri Jan 26 06:50:16 2007
> @@ -83,7 +83,6 @@
>  
>          testCon = new AMQConnection("vm://:1", "guest", "guest", "TestConnection", "test");
>          testSession = testCon.createSession(false, AMQSession.NO_ACKNOWLEDGE);
> -        testConsumer1 = testSession.createConsumer(queue1);
>          testConsumer2 = testSession.createConsumer(queue2);
>          testCon.start();
>      }
> @@ -115,6 +114,7 @@
>          expect("Y", testConsumer2.receive(1000));
>          expect("Z", testConsumer2.receive(1000));
>  
> +        testConsumer1 = testSession.createConsumer(queue1);
>          assertTrue(null == testConsumer1.receive(1000));
>          assertTrue(null == testConsumer2.receive(1000));
>      }
> @@ -136,6 +136,7 @@
>          expect("B", consumer1.receive(1000));
>          expect("C", consumer1.receive(1000));
>  
> +        testConsumer1 = testSession.createConsumer(queue1);
>          assertTrue(null == testConsumer1.receive(1000));
>          assertTrue(null == testConsumer2.receive(1000));
>      }
>
>
>
>   


Re: svn commit: r500264 - /incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java

Posted by Kim van der Riet <ki...@redhat.com>.
Thanks for the patch. I have noticed this intermittently on the 0-9
branch, but you have beaten me to tracking it down. Patch applied in
revision 500310.

Kim

On Fri, 2007-01-26 at 15:27 -0330, Jonathan Anstey wrote:
> Hi,
> 
> This particular commit caused the testAcknowledgePerConsumer test to 
> fail in org.apache.qpid.test.unit.ack.RecoverTest. For some reason it 
> seems that queue1 in TransactedTest.java lingers around after the test 
> has completed. In RecoverTest.java, the same queue is picked up and 
> causes the following error to occur:
> 
> testAcknowledgePerConsumer(org.apache.qpid.test.unit.ack.RecoverTest)  
> Time elapsed: 0.037 sec  <<< FAILURE!
> junit.framework.ComparisonFailure: expected:<msg1> but was:<A>
>         at junit.framework.Assert.assertEquals(Assert.java:81)
>         at junit.framework.Assert.assertEquals(Assert.java:87)
>         at 
> org.apache.qpid.test.unit.ack.RecoverTest.testAcknowledgePerConsumer(RecoverTest.java:204)
> 
> The message "A" comes from queue1 in TransactedTest.java.  I have 
> attached a patch for TransactedTest.java to fix this problem. My fix 
> basically setup queue1 to auto delete so it won't be around for the 
> other tests.
> 
> Cheers,
> Jon



Re: svn commit: r500264 - /incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java

Posted by Kim van der Riet <ki...@redhat.com>.
Thanks for the patch. I have noticed this intermittently on the 0-9
branch, but you have beaten me to tracking it down. Patch applied in
revision 500310.

Kim

On Fri, 2007-01-26 at 15:27 -0330, Jonathan Anstey wrote:
> Hi,
> 
> This particular commit caused the testAcknowledgePerConsumer test to 
> fail in org.apache.qpid.test.unit.ack.RecoverTest. For some reason it 
> seems that queue1 in TransactedTest.java lingers around after the test 
> has completed. In RecoverTest.java, the same queue is picked up and 
> causes the following error to occur:
> 
> testAcknowledgePerConsumer(org.apache.qpid.test.unit.ack.RecoverTest)  
> Time elapsed: 0.037 sec  <<< FAILURE!
> junit.framework.ComparisonFailure: expected:<msg1> but was:<A>
>         at junit.framework.Assert.assertEquals(Assert.java:81)
>         at junit.framework.Assert.assertEquals(Assert.java:87)
>         at 
> org.apache.qpid.test.unit.ack.RecoverTest.testAcknowledgePerConsumer(RecoverTest.java:204)
> 
> The message "A" comes from queue1 in TransactedTest.java.  I have 
> attached a patch for TransactedTest.java to fix this problem. My fix 
> basically setup queue1 to auto delete so it won't be around for the 
> other tests.
> 
> Cheers,
> Jon