GitHub user jdanekrh opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1407

    ARTEMIS-1276 fix JmsSendReceiveWithMessageExpirationTest [wip]

    The JmsSendReceiveWithMessageExpirationTest#testConsumeExpiredQueueAndDlq 
test used to fail with
    
    > 
JmsQueueCompositeSendReceiveTest>CombinationTestSupport.runBare:144->CombinationTestSupport.runBare:138->testSendReceive:86->JmsSendReceiveTestSupport.testSendReceive:
    > 
115->JmsSendReceiveTestSupport.assertMessagesAreReceived:156->JmsSendReceiveTestSupport.assertMessagesReceivedAreValid:176
 Invalid number of messages received
    > expected:<100> but was:<0>
    
    After the changes in this PR, it is now failing with
    
        junit.framework.AssertionFailedError: got dlq messages 
        Expected :99
        Actual   :90
    
    I can get it to pass if I disable prefetch, that is, I also change
    
    ```
    diff --git 
a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java
 
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java
    index dffd72296..3ff305810 100644
    --- 
a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java
    +++ 
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java
    @@ -126,7 +126,7 @@ public class JmsSendReceiveWithMessageExpirationTest 
extends TestSupport {
     
           Connection consumerConnection = createConnection();
           ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
    -      prefetchPolicy.setAll(10);
    +      prefetchPolicy.setAll(0);
           ((ActiveMQConnection) 
consumerConnection).setPrefetchPolicy(prefetchPolicy);
           Session consumerSession = consumerConnection.createSession(false, 
Session.CLIENT_ACKNOWLEDGE);
           MessageConsumer consumer = 
consumerSession.createConsumer(consumerDestination);
    ```
    
    I do not understand why prefetch breaks the test, and I do not know how to 
begin investigating this effectively...

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jdanekrh/activemq-artemis 
jd_JmsSendReceiveWithMessageExpirationTest

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/1407.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1407
    
----
commit b629c1b2835af5e60593ec6c79adce83d7962ece
Author: Jiri Danek <[email protected]>
Date:   2017-06-26T13:16:44Z

    ARTEMIS-1276 fix JmsSendReceiveWithMessageExpirationTest

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to