activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuconic <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1625: ARTEMIS-1490 Race on address delete
Date Tue, 31 Oct 2017 13:09:08 GMT
Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1625#discussion_r147988933
  
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java
---
    @@ -261,6 +261,42 @@ public void testAutoCreateMulticastAddress() throws Throwable {
        }
     
        @Test
    +   public void testAutoCreateCOnConsumer() throws Throwable {
    +
    +      final SimpleString thisQueue = SimpleString.toSimpleString("ThisQueue");
    +      if (!isNetty()) {
    +         // no need to run the test, there's no AMQP support
    +         return;
    +      }
    +
    +      for (int i = 0; i < 10; i++) {
    +         ConnectionFactory factorySend = createFactory(2);
    +         Connection connection = factorySend.createConnection();
    +
    +         try {
    +            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    +            javax.jms.Queue queue = session.createQueue(thisQueue.toString());
    +            MessageProducer producer = session.createProducer(queue);
    +
    +            MessageConsumer consumer = session.createConsumer(queue);
    +            connection.start();
    +
    +            producer.send(session.createTextMessage("hello"));
    +
    +            Assert.assertNotNull(consumer.receive(5000));
    +            consumer.close();
    +            session.close();
    +         } finally {
    +            connection.close();
    +         }
    +
    +         Wait.waitFor(() -> server.getAddressInfo(thisQueue) == null, 1000, 10);
    --- End diff --
    
    @mtaylor without that change, this will always fail on this loop (at least on my laptop).


---

Mime
View raw message