[ 
https://issues.apache.org/jira/browse/ARTEMIS-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16572881#comment-16572881
 ] 

ASF GitHub Bot commented on ARTEMIS-2016:
-----------------------------------------

GitHub user jdanekrh opened a pull request:

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

    ARTEMIS-2016 fix flaky test QueueControlTest#testRemoveAllWithPagingMode

    Parameters going into Wait.waitFor were originally wrong, because
    `durationMillis: 3, sleepMillis: 100` means you would test the condition
    only once. This commit is changing the durationMillis from 3ms to 3s,
    swapping the two numbers (duration 100ms, sleep 3ms) would also be 
reasonable, I think.
    
    Next, Wait.assertEquals is here being used, instead of Assert.assertTrue.
    
    I saw the test fail only once, and never was able to reproduce it again,
    but I think this commit does improve the test and so it is worthwhile.
    
        java.lang.AssertionError
                at 
org.apache.activemq.artemis.tests.integration.management.QueueControlTest.assertMetrics(QueueControlTest.java:2651)
            at 
org.apache.activemq.artemis.tests.integration.management.QueueControlTest.assertMessageMetrics(QueueControlTest.java:2615)
                at 
org.apache.activemq.artemis.tests.integration.management.QueueControlTest.testRemoveAllWithPagingMode(QueueControlTest.java:1554)

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

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

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

    https://github.com/apache/activemq-artemis/pull/2226.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 #2226
    
----
commit baaefa15595da5ec30218ca1b35d9fe80512007e
Author: Jiri Danek <jdanek@...>
Date:   2018-08-07T16:22:57Z

    ARTEMIS-2016 fix flaky test QueueControlTest#testRemoveAllWithPagingMode
    
    Parameters going into Wait.waitFor were originally wrong, because
    `durationMillis: 3, sleepMillis: 100` means you would test the condition
    only once. This commit is changing the durationMillis from 3ms to 3s,
    swapping the two numbers (duration 100ms, sleep 3ms) would also be 
reasonable, I think.
    
    Next, Wait.assertEquals is here being used, instead of Assert.assertTrue.
    
    I saw the test fail only once, and never was able to reproduce it again,
    but I think this commit does improve the test and so it is worthwhile.
    
        java.lang.AssertionError
                at 
org.apache.activemq.artemis.tests.integration.management.QueueControlTest.assertMetrics(QueueControlTest.java:2651)
            at 
org.apache.activemq.artemis.tests.integration.management.QueueControlTest.assertMessageMetrics(QueueControlTest.java:2615)
                at 
org.apache.activemq.artemis.tests.integration.management.QueueControlTest.testRemoveAllWithPagingMode(QueueControlTest.java:1554)

----


> Wait.waitFor is sometimes called with zero timeout (durationMillis), or with 
> durationMillis < sleepMillis
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2016
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2016
>             Project: ActiveMQ Artemis
>          Issue Type: Test
>    Affects Versions: 2.7.0
>            Reporter: Jiri Daněk
>            Priority: Major
>
> {{timeout = 0}} happens in 
> {{org.apache.activemq.artemis.tests.integration.clientcrash.ClientTestBase#assertActiveConnections(int)}}
>  and 
> {{org.apache.activemq.artemis.tests.integration.clientcrash.ClientTestBase#assertActiveSession(int)}}.
> {{durationMillis < sleepMillis}} happens in 
> {{org.apache.activemq.artemis.tests.integration.management.QueueControlTest#assertMetrics}}
> I am not sure what the intent of the author of the test was, but the current 
> status seems wrong. The test {{QueueControlTest#testRemoveAllWithPagingMode}} 
> is flaky due to insufficient number of retry attempts in 
> {{QueueControlTest#assertMetrics}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to