The test failure like the one below occurs occasionally on jenkins job Qpid-Python-Java-Test:
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
In order to fix the test, the following can be done:
- change the test to receive all 10 messages before sending release/accept
- send release/accept after receiving of 10 messages