ARTEMIS-4125 Fixing AutoCreateJmsDestinationTest::testAutoCreateOnSubscribeToTopic

This commit is contained in:
Clebert Suconic 2023-01-12 12:45:56 -05:00 committed by clebertsuconic
parent c231e6a643
commit abd62665ce
2 changed files with 6 additions and 1 deletions

View File

@ -1133,7 +1133,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
}
logger.debug("deleting temporary queue {}", bindingName);
AddressInfo addressInfo = server.getAddressInfo(binding.getAddress());
server.destroyQueue(bindingName, null, false, false, addressInfo == null || addressInfo.isTemporary() || addressInfo.isAutoCreated());
server.destroyQueue(bindingName, null, false, false, addressInfo == null || addressInfo.isTemporary());
if (observer != null) {
observer.tempQueueDeleted(bindingName);
}

View File

@ -39,6 +39,8 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
import org.apache.activemq.artemis.api.core.management.ResourceNames;
import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
import org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl;
import org.apache.activemq.artemis.core.postoffice.impl.PostOfficeTestAccessor;
import org.apache.activemq.artemis.core.security.Role;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
@ -299,6 +301,9 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase {
connection.close();
PostOfficeTestAccessor.reapAddresses((PostOfficeImpl) server.getPostOffice());
PostOfficeTestAccessor.reapAddresses((PostOfficeImpl) server.getPostOffice());
Wait.assertTrue(() -> server.getManagementService().getResource(ResourceNames.ADDRESS + topicName) == null);
}