AnonHxy commented on code in PR #16540:
URL: https://github.com/apache/pulsar/pull/16540#discussion_r941972953
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java:
##########
@@ -979,7 +981,32 @@ public void testLookupThrottlingForClientByClient() throws
Exception {
EventLoopGroup eventLoop = EventLoopUtil.newEventLoopGroup(20, false,
new DefaultThreadFactory("test-pool",
Thread.currentThread().isDaemon()));
long reqId = 0xdeadbeef;
- try (ConnectionPool pool = new ConnectionPool(conf, eventLoop)) {
+
+ Semaphore clientCnxSemaphore = new Semaphore(1);
+ AtomicInteger count = new AtomicInteger(2);
+ try (ConnectionPool pool = new ConnectionPool(conf, eventLoop, () ->
new ClientCnx(conf, eventLoop) {
+ @Override
+ protected void handleLookupResponse(CommandLookupTopicResponse
lookupResult) {
+ try {
+ clientCnxSemaphore.acquire();
Review Comment:
`await` & `notifyAll` Still have the same problem that is thread can only
`await` once.
> CountDownLatch has a problem that it can not reset it's count, which means
we can not reuse it with multi cases in this test
Maybe we can used an array `CountDownLatch[]` to reset a new CountDownLatch
object. I have updated it, please take a look again @poorbarcode, thanks.
--
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]