7 Replies Latest reply on Mar 31, 2009 9:27 AM by burdeasa

    Test org.jboss.test.jbossmessaging.test.JBossJMSUnitTestCase

      I work for Unisys corporation. I'm attempting to certify JBoss EAP 4.3 CP04 running on our MCP system. This apparently includes JBoss Messaging 1.4.0.SP3_CP07-brew.

      When I run the JBoss testsuite, over 99% of the tests pass, but I have a few stubborn failures.

      In particular, the test org.jboss.test.jbossmessaging.test.JBossJMSUnitTestCase passes about half of the time, but fails about the other half when I run it individually. When the test fails, the testcase testRequestReplyQueue hangs and the test.log file shows:

      2009-03-23 16:13:45,500 ERROR [org.jboss.test.jbossmessaging.test.JBossJMSUnitTestCase$1] Error
      java.lang.UnsupportedOperationException: Destination not specified
       at org.jboss.jms.client.container.ProducerAspect.handleSend(ProducerAspect.java:157)
       at org.jboss.aop.advice.org.jboss.jms.client.container.ProducerAspect46.invoke(ProducerAspect46.java)
       at org.jboss.jms.client.delegate.ClientProducerDelegate$send_3961598017717988886.invokeNext(ClientProducerDelegate$send_3961598017717988886.java)
       at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
       at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
       at org.jboss.jms.client.delegate.ClientProducerDelegate$send_3961598017717988886.invokeNext(ClientProducerDelegate$send_3961598017717988886.java)
       at org.jboss.jms.client.delegate.ClientProducerDelegate.send(ClientProducerDelegate.java)
       at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:164)
       at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:207)
       at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:145)
       at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:136)
       at org.jboss.test.jbossmessaging.test.JBossJMSUnitTestCase$1.run(JBossJMSUnitTestCase.java:248)


      This appears to be similar to the error reported in
      https://jira.jboss.org/jira/browse/JBMESSAGING-1259

      However, that JIRA entry has no information about the problem cause or solution.

      I have spent many hours over several days trying to determine how the destination could be null in some cases (causing the failure), and OK in other cases. So far, I have been unable to determine the cause.

      Is there anyone who might be able to give me a clue?

      Thanks!


        • 1. Re: Test org.jboss.test.jbossmessaging.test.JBossJMSUnitTest
          gaohoward

          Can you give more about your test here? for example the code you use to create the producer. Thanks.

          • 2. Re: Test org.jboss.test.jbossmessaging.test.JBossJMSUnitTest
            timfox

            This is probably an AOP problem caused by not having the correct libraries on the client side.

            Please check you have the correct libraries on the classpath as specified in the user guide.

            • 3. Re: Test org.jboss.test.jbossmessaging.test.JBossJMSUnitTest

              Just to clarify:
              The test I am running is not a test that I wrote. I am running the test org.jboss.test.jbossmessaging.test.JBossJMSUnitTestCase that comes with the JBoss Application Server source code.

              To run the test, I run the provided ant script which automatically sets up the classpath for the JUnit client.

              I looked at the classpath being passed to JUnit and it looked correct as far as I could tell.

              • 4. Re: Test org.jboss.test.jbossmessaging.test.JBossJMSUnitTest
                timfox

                I asked Phillip from QA who posted that original JIRA what the problem was. He said it as a configuration issue on his side, but couldn't remember the details.

                Those tests are the JBoss AS integration tests. In JBM we have our own tests. The AS integration tests are run successfully before each release of JBoss AS.

                • 5. Re: Test org.jboss.test.jbossmessaging.test.JBossJMSUnitTest
                  clebert.suconic

                  There's probably a race on deployment for that test.

                  I wouldn't bother too much about it...


                  But if you want to fix it.. you probably need a sleep on setup().

                  • 6. Re: Test org.jboss.test.jbossmessaging.test.JBossJMSUnitTest
                    clebert.suconic

                    (or of course, someone should find a proper fix, to make sure the test is only started after the deployment is finished).

                    • 7. Re: Test org.jboss.test.jbossmessaging.test.JBossJMSUnitTest

                      Thanks for the responses everyone.

                      I think I have found a solution.

                      I added debug code to testcase RequestReplyQueue and noticed that the test was receiving the following message text on the queue: High Priority Persistent message.

                      This message text is placed on the queue by the previous testcase (QueueMessageOrder). The messages from the previous testcase were still on the queue, which appears to have lead to problems with the testcase RequestReplyQueue. Testcase RequestReplyQueue calls the method drainQueue to remove any leftover messages. However, from the test.log file I could tell that drainQueue was not removing any messages in the failing scenario. The code in drainQueue has a timeout of 50 milliseconds to receive a message. I guessed that maybe this was too short sometimes, so I increased the timeout from 50 to 500. After making this change, I have run the test 10 times in a row without a failure, so this appears to be the solution.