You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by jbertram <gi...@git.apache.org> on 2017/03/13 17:46:55 UTC

[GitHub] activemq-artemis pull request #1092: NO-JIRA fix race in TopicControlCluster...

GitHub user jbertram opened a pull request:

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

    NO-JIRA fix race in TopicControlClusterTest

    Test didn't account for "remote" queue bindings from other cluster
    member which caused a race condition.

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

    $ git pull https://github.com/jbertram/activemq-artemis master_work

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

    https://github.com/apache/activemq-artemis/pull/1092.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 #1092
    
----
commit bf5ca678eef70b885b433e6200a94c54935f7982
Author: Justin Bertram <jb...@apache.org>
Date:   2017-03-13T17:40:51Z

    NO-JIRA fix race in TopicControlClusterTest
    
    Test didn't account for "remote" queue bindings from other cluster
    member which caused a race condition.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis pull request #1092: NO-JIRA fix race in TopicControlCluster...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis pull request #1092: NO-JIRA fix race in TopicControlCluster...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1092#discussion_r105907994
  
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlClusterTest.java ---
    @@ -50,16 +49,22 @@ public void testClusteredSubscriptionCount() throws Exception {
              Session session2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
              session2.createDurableSubscriber(topic2, "sub2");
     
    -         SimpleString add1 = new SimpleString(topic1.getTopicName());
    -         SimpleString add2 = new SimpleString(topic2.getTopicName());
    -         AddressControl topicControl1 = ManagementControlHelper.createAddressControl(add1, mBeanServer1);
    -         AddressControl topicControl2 = ManagementControlHelper.createAddressControl(add2, mBeanServer2);
    +         AddressControl topicControl1 = ManagementControlHelper.createAddressControl(simpleTopicName, mBeanServer1);
    +         AddressControl topicControl2 = ManagementControlHelper.createAddressControl(simpleTopicName, mBeanServer2);
    +
    +         assertTrue("There should be 3 subscriptions on the topic, 2 local and 1 remote.", Wait.waitFor(new Wait.Condition() {
    +            @Override
    +            public boolean isSatisfied() throws Exception {
    +               return topicControl1.getQueueNames().length == 3;
    +            }
    +         }, 2000));
     
    -         assertEquals(2, topicControl1.getQueueNames().length);
    -         assertEquals(1, topicControl2.getQueueNames().length);
    -      } finally {
    -         conn1.close();
    -         conn2.close();
    +         assertTrue("There should be 3 subscriptions on the topic, 1 local and 2 remote.", Wait.waitFor(new Wait.Condition() {
    --- End diff --
    
    We should start using java8 things here.. much cleaner:
    
    For example, expressions
    ```java
             assertTrue("There should be 3 subscriptions on the topic, 2 local and 1 remote.", Wait.waitFor(() -> topicControl1.getQueueNames().length == 3, 2000));
    
             assertTrue("There should be 3 subscriptions on the topic, 1 local and 2 remote.", Wait.waitFor(() -> topicControl2.getQueueNames().length == 3, 2000));
    ```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---