tabish121 commented on PR #6300:
URL: https://github.com/apache/artemis/pull/6300#issuecomment-4085232337

   I have a feeling this might lead to some failure churn in the tests so I 
full CI run is advised
   
   The following tests can reproduce this with certainly and no looping:
   
   ```
   @Test
      @Timeout(20)
      public void testTemporaryTopicDeletedOnConnectionClosed() throws 
Exception {
         doTestTemporaryDestinationIsDeletedOnConnectionClosed(true, true);
      }
   
      @Test
      @Timeout(20)
      public void testTemporaryQueueDeletedOnConnectionClosed() throws 
Exception {
         doTestTemporaryDestinationIsDeletedOnConnectionClosed(false, true);
      }
   
      @Test
      @Timeout(20)
      public void 
testTemporaryTopicDeletedOnConnectionClosedWithoutExplicitConsumerClose() 
throws Exception {
         doTestTemporaryDestinationIsDeletedOnConnectionClosed(true, false);
      }
   
      @Test
      @Timeout(20)
      public void 
testTemporaryQueueDeletedOnConnectionClosedWithoutExplicitConsumerClose() 
throws Exception {
         doTestTemporaryDestinationIsDeletedOnConnectionClosed(false, false);
      }
   
      private void 
doTestTemporaryDestinationIsDeletedOnConnectionClosed(boolean topic, boolean 
closeConsumer) throws Exception {
         try (Connection connection = createConnection()) {
            final Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
            final Destination destination;
            final String addressName;
   
            if (topic) {
               destination = session.createTemporaryTopic();
   
               assertNotNull(destination);
               assertTrue(destination instanceof TemporaryTopic);
   
               addressName = ((TemporaryTopic) destination).getTopicName();
            } else {
               destination = session.createTemporaryQueue();
   
               assertNotNull(destination);
               assertTrue(destination instanceof TemporaryQueue);
   
               addressName = ((TemporaryQueue) destination).getQueueName();
            }
   
            final MessageConsumer consumer = 
session.createConsumer(destination);
   
            final AddressInfo addressView = getProxyToAddress(addressName);
            assertNotNull(addressView);
   
            assertEquals(1, 
server.bindingQuery(addressView.getName()).getQueueNames().size());
   
            if (closeConsumer) {
               consumer.close();
            }
   
            connection.close();
   
            Wait.assertNull(() -> getProxyToAddress(addressName), 
TimeUnit.SECONDS.toMillis(5), TimeUnit.MILLISECONDS.toMillis(50));
         }
      }
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to