Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-7222

Python test qpid_tests.broker_0_10.message.MessageTests.test_release_order fails sporadically against java broker




      The test failure like the one below occurs occasionally on jenkins job Qpid-Python-Java-Test:

      qpid_tests.broker_0_10.message.MessageTests.test_release_order (from (TEST-python_pre1.0.xml))
      Failing for the past 1 build (Since Failed#1002 )
      Took 0.11 sec.
      Error during test:  Traceback (most recent call last):
          File "/home/jenkins/jenkins-slave/workspace/Qpid-Python-Java-Test/site-packages/bin/qpid-python-test", line 340, in run
          File "/home/jenkins/jenkins-slave/workspace/Qpid-Python-Java-Test/site-packages/lib/python2.7/site-packages/qpid_tests/broker_0_10/message.py", line 1028, in test_release_order
            self.assertEquals("message-%d" % (i), msg.body)
          File "/usr/lib/python2.7/unittest/case.py", line 511, in assertEqual
            assertion_func(first, second, msg=msg)
          File "/usr/lib/python2.7/unittest/case.py", line 504, in _baseAssertEqual
            raise self.failureException(msg)
        AssertionError: 'message-8' != 'message-2'

      Python test MessageTests.test_release_order tests that released messages are delivered in correct order.

      The test makes an assumption that expected 10 messages are pre-fetched immediately.

      It seems that test assumptions are not exactly correct, for example, when less then 10 messages are pre-fetched , it is possible that broker can try to re-deliver previously released message after receiving accept/released commands for pre-fetched messages. That is what happens when test fails with java broker. It seems that only 7 messages have been pre-fetched by the client. After receiving accept/release commands for those prefetched messages, the broker starts re-delivery of released messages causing test to fail.

      The Java Broker exhibited behavior is inline with 0-10 spec for message.release which states

      When acquired messages are released, they become available for acquisition by any subscriber.

      Acquired messages that have been released MAY subsequently be delivered out of order. Implementations SHOULD ensure that released messages keep their position with respect to undelivered messages of the
      same priority.

      In order to fix the test, the following can be done:

      1. change the test to receive all 10 messages before sending release/accept
      2. send release/accept after receiving of 10 messages




            • Assignee:
              kwall Keith Wall
              orudyy Alex Rudyy
            • Votes:
              0 Vote for this issue
              4 Start watching this issue


              • Created: