Qpid
  1. Qpid
  2. QPID-3164

Occasional test failures from SimpleAMQQueueTest.testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.10, 0.11
    • Fix Version/s: 0.11
    • Component/s: Java Tests
    • Labels:
      None

      Description

      QPID-2900 added a new test case SimpleAMQQueueTest.testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions which aims to verify that the method SimpleAMQQueue.requeue(QueueEntry, Subscription) behaves correctly and correctly requeues an entry for a specific subscription. The test is showing sporadic test failures.

      junit.framework.AssertionFailedError: Unexpected total number of messages sent to subscription1 after enqueue expected:<1> but was:<0>
      at org.apache.qpid.server.queue.SimpleAMQQueueTest.testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions(SimpleAMQQueueTest.java:453)
      at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:120)

      I notice that the test case has even failed on the new Jenkins instance:

      https://builds.apache.org/hudson/pview/job/qpid-java-build/7/testReport/junit/org.apache.qpid.server.queue/SimpleAMQQueueTest/testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions/

        Activity

        Keith Wall created issue -
        Keith Wall made changes -
        Field Original Value New Value
        Assignee Robbie Gemmell [ gemmellr ] Keith Wall [ k-wall ]
        Show
        Andrew Kennedy added a comment - See also this other test in the same class: https://hudson.apache.org/hudson/job/qpid-java-build/14/testReport/org.apache.qpid.server.queue/SimpleAMQQueueTest/testRequeueForQueueWithMultipleSubscriptions/
        Keith Wall made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Keith Wall made changes -
        Component/s Java Tests [ 12311960 ]
        Component/s Java Broker [ 12311388 ]
        Hide
        Keith Wall added a comment - - edited

        Thanks Andrew. The problems are in the test cases I added whilst addressing QPID-2900.

        The first problem is that test testRequeueForQueueWithMultipleSubscriptions assumes that message delivery to multiple subscriptions is deterministic, when it is not. The test assumes that 1 message will go the first, and 1 to second. This might or might not be the case depending on the actions of SubFlushRunner and QueueRunner.

        The second problem is that the tests call QueueEntry.release, then call SimpleAMQQueue.requeue(). This is incorrect since QueueEntry.release() is responsible for making the call to SimpleAMQQueue.requeue(). This explains why testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions is sometimes seen to fail. The test hopes to cause the entry to go to a particular subscription (using SimpleAMQQueue.requeue(queueEntry, sub)), but since the test calls release(), the requeue could go to either subscription.

        However, I notice that SimpleAMQQueue.requeue(QueueEntryImpl, Subscription) and QueueEntryImpl.requeue(QueueEntryImp, Subscription subscription) appear to be dead code. SimpleAMQQueue.requeue(QueueEntryImpl, Subscription) was used by SubscriptionImpl by this was removed by commit afcf8099695253651c73910a243fb29aa520b008 (Merged from java-broker-0-10 branch) in Oct-2009.

        I'll prepare a patch to fix the test and remove these dead methods.

        Show
        Keith Wall added a comment - - edited Thanks Andrew. The problems are in the test cases I added whilst addressing QPID-2900 . The first problem is that test testRequeueForQueueWithMultipleSubscriptions assumes that message delivery to multiple subscriptions is deterministic, when it is not. The test assumes that 1 message will go the first, and 1 to second. This might or might not be the case depending on the actions of SubFlushRunner and QueueRunner. The second problem is that the tests call QueueEntry.release, then call SimpleAMQQueue.requeue(). This is incorrect since QueueEntry.release() is responsible for making the call to SimpleAMQQueue.requeue(). This explains why testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions is sometimes seen to fail. The test hopes to cause the entry to go to a particular subscription (using SimpleAMQQueue.requeue(queueEntry, sub)), but since the test calls release(), the requeue could go to either subscription. However, I notice that SimpleAMQQueue.requeue(QueueEntryImpl, Subscription) and QueueEntryImpl.requeue(QueueEntryImp, Subscription subscription) appear to be dead code. SimpleAMQQueue.requeue(QueueEntryImpl, Subscription) was used by SubscriptionImpl by this was removed by commit afcf8099695253651c73910a243fb29aa520b008 (Merged from java-broker-0-10 branch) in Oct-2009. I'll prepare a patch to fix the test and remove these dead methods.
        Keith Wall made changes -
        Description QPID-2900 added a new test case SimpleAMQQueueTest.testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions which aims to verify that the method SimpleAMQQueue.requeue(QueueEntry, Subscription) behaves correctly and correctly requeues a entry for a specific subscription. The test is showing sporadic test failures.

        junit.framework.AssertionFailedError: Unexpected total number of messages sent to subscription1 after enqueue expected:<1> but was:<0>
        at org.apache.qpid.server.queue.SimpleAMQQueueTest.testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions(SimpleAMQQueueTest.java:453)
        at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:120)

        I notice that the test case has even failed on the new Jenkins instance:

        https://builds.apache.org/hudson/pview/job/qpid-java-build/7/testReport/junit/org.apache.qpid.server.queue/SimpleAMQQueueTest/testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions/

        QPID-2900 added a new test case SimpleAMQQueueTest.testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions which aims to verify that the method SimpleAMQQueue.requeue(QueueEntry, Subscription) behaves correctly and correctly requeues an entry for a specific subscription. The test is showing sporadic test failures.

        junit.framework.AssertionFailedError: Unexpected total number of messages sent to subscription1 after enqueue expected:<1> but was:<0>
        at org.apache.qpid.server.queue.SimpleAMQQueueTest.testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions(SimpleAMQQueueTest.java:453)
        at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:120)

        I notice that the test case has even failed on the new Jenkins instance:

        https://builds.apache.org/hudson/pview/job/qpid-java-build/7/testReport/junit/org.apache.qpid.server.queue/SimpleAMQQueueTest/testSubscriptionSpecificRequeueForQueueWithMultipleSubscriptions/

        Keith Wall made changes -
        Status In Progress [ 3 ] Ready To Review [ 10006 ]
        Hide
        Keith Wall added a comment -

        Hi Robbie could you take a look please?

        Show
        Keith Wall added a comment - Hi Robbie could you take a look please?
        Keith Wall made changes -
        Assignee Keith Wall [ k-wall ] Robbie Gemmell [ gemmellr ]
        Hide
        Robbie Gemmell added a comment -

        Patches applied.

        Show
        Robbie Gemmell added a comment - Patches applied.
        Robbie Gemmell made changes -
        Status Ready To Review [ 10006 ] Resolved [ 5 ]
        Fix Version/s 0.11 [ 12316272 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Keith Wall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development