提交 4f22047c 编写于 作者: M Matteo Merli 提交者: GitHub

Fix #644: BrokerServiceThrottlingTest.testLookupThrottlingForClientByBroker...

Fix #644: BrokerServiceThrottlingTest.testLookupThrottlingForClientByBroker intermittent failures (#645)
上级 b1e28d1c
...@@ -68,7 +68,7 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase { ...@@ -68,7 +68,7 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
/** /**
* Verifies: updating zk-thottling node reflects broker-maxConcurrentLookupRequest and updates semaphore. * Verifies: updating zk-thottling node reflects broker-maxConcurrentLookupRequest and updates semaphore.
* *
* @throws Exception * @throws Exception
*/ */
@Test @Test
...@@ -83,7 +83,7 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase { ...@@ -83,7 +83,7 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
/** /**
* Broker has maxConcurrentLookupRequest = 0 so, it rejects incoming lookup request and it cause consumer creation * Broker has maxConcurrentLookupRequest = 0 so, it rejects incoming lookup request and it cause consumer creation
* failure. * failure.
* *
* @throws Exception * @throws Exception
*/ */
@Test @Test
...@@ -122,12 +122,12 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase { ...@@ -122,12 +122,12 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
/** /**
* Verifies: Broker side throttling: * Verifies: Broker side throttling:
* *
* <pre> * <pre>
* 1. concurrent_consumer_creation > maxConcurrentLookupRequest at broker * 1. concurrent_consumer_creation > maxConcurrentLookupRequest at broker
* 2. few of the consumer creation must fail with TooManyLookupRequestException. * 2. few of the consumer creation must fail with TooManyLookupRequestException.
* </pre> * </pre>
* *
* @throws Exception * @throws Exception
*/ */
@Test @Test
...@@ -173,8 +173,10 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase { ...@@ -173,8 +173,10 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
} }
latch.await(); latch.await();
for (int i = 0; i < successfulConsumers.size(); i++) { for (Consumer c : successfulConsumers) {
successfulConsumers.get(i).close(); if (c != null) {
c.close();
}
} }
pulsarClient.close(); pulsarClient.close();
assertNotEquals(successfulConsumers.size(), totalConsumers); assertNotEquals(successfulConsumers.size(), totalConsumers);
...@@ -183,14 +185,14 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase { ...@@ -183,14 +185,14 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
/** /**
* This testcase make sure that once consumer lost connection with broker, it always reconnects with broker by * This testcase make sure that once consumer lost connection with broker, it always reconnects with broker by
* retrying on throttling-error exception also. * retrying on throttling-error exception also.
* *
* <pre> * <pre>
* 1. all consumers get connected * 1. all consumers get connected
* 2. broker restarts with maxConcurrentLookupRequest = 1 * 2. broker restarts with maxConcurrentLookupRequest = 1
* 3. consumers reconnect and some get TooManyRequestException and again retries * 3. consumers reconnect and some get TooManyRequestException and again retries
* 4. eventually all consumers will successfully connect to broker * 4. eventually all consumers will successfully connect to broker
* </pre> * </pre>
* *
* @throws Exception * @throws Exception
*/ */
@Test @Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册