NO-JIRA fix race condition in QueueQueryTest
authorJustin Bertram <jbertram@apache.org>
Mon, 4 Feb 2019 22:01:37 +0000 (16:01 -0600)
committerJustin Bertram <jbertram@apache.org>
Mon, 4 Feb 2019 22:04:50 +0000 (16:04 -0600)
My previous commit to fix this was amended which nullified the fix.

tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/QueueQueryTest.java

index 1d21f73..3771119 100644 (file)
@@ -161,14 +161,14 @@ public class QueueQueryTest extends ActiveMQTestBase {
          QueueQueryResult queueQueryResult = server.queueQuery(fqqn);
          assertEquals(queueName, queueQueryResult.getName());
          assertEquals(addressName, queueQueryResult.getAddress());
-         Wait.assertEquals(1, server.queueQuery(fqqn)::getMessageCount);
+         Wait.assertEquals(1, () -> server.queueQuery(fqqn).getMessageCount());
          queueQueryResult = server.queueQuery(queueName);
          assertEquals(queueName, queueQueryResult.getName());
          assertEquals(addressName, queueQueryResult.getAddress());
          assertEquals(1, queueQueryResult.getMessageCount());
          c.createProducer().send(c.createQueue(addressName.toString()), c.createMessage());
-         Wait.assertEquals(2, server.queueQuery(fqqn)::getMessageCount);
-         Wait.assertEquals(2, server.queueQuery(queueName)::getMessageCount);
+         Wait.assertEquals(2, () -> server.queueQuery(fqqn).getMessageCount());
+         Wait.assertEquals(2, () -> server.queueQuery(queueName).getMessageCount());
       }
    }