gtully commented on a change in pull request #3863:
URL: https://github.com/apache/activemq-artemis/pull/3863#discussion_r761909992



##########
File path: 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java
##########
@@ -85,6 +89,34 @@ public void testCreditsAreAllocatedOnceOnLinkCreated() 
throws Exception {
       }
    }
 
+   @Test(timeout = 60000)
+   public void 
testCreditsAreNotAllocatedOnceOnLinkCreatedWhileBlockedAndWhenUnBlocked() 
throws Exception {
+      AmqpClient client = createAmqpClient(new URI(singleCreditAcceptorURI));
+      AmqpConnection connection = addConnection(client.connect());
+
+      try {
+         AddressControl addressControl = 
ManagementControlHelper.createAddressControl(SimpleString.toSimpleString(getQueueName()),
 mBeanServer);
+         addressControl.block();
+         AmqpSession session = connection.createSession();
+         final AmqpSender sender = session.createSender(getQueueName());
+         assertEquals("Should get 0 credit", 0, 
sender.getSender().getCredit());
+
+         addressControl.unBlock();
+         assertTrue("Should now get issued one credit", Wait.waitFor(new 
Wait.Condition() {
+            @Override
+            public boolean isSatisfied() throws Exception {
+               return 1 == sender.getSender().getCredit();
+            }
+         }));

Review comment:
       fair, it will speed up the test a little




-- 
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]


Reply via email to