congbobo184 commented on code in PR #17389:
URL: https://github.com/apache/pulsar/pull/17389#discussion_r980786813


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SubscriptionMessageDispatchThrottlingTest.java:
##########
@@ -467,16 +467,16 @@ private void testDispatchRate(SubscriptionType 
subscription,
         long start = System.currentTimeMillis();
         // Asynchronously produce messages
         for (int i = 0; i < numProducedMessages; i++) {
-            producer.send(new byte[expectRate / 10]);
+            producer.sendAsync(new byte[expectRate / 10]);
         }
         latch.await();
         Assert.assertEquals(totalReceived.get(), numProducedMessages, 10);
         long end = System.currentTimeMillis();
         log.info("-- end - start: {} ", end - start);
 
         // first 10 messages, which equals receiverQueueSize, will not wait.
-        Assert.assertTrue((end - start) >= 2500);
-        Assert.assertTrue((end - start) <= 8000);
+        Assert.assertEquals((end - start), numProducedMessages * expectRate / 
10,

Review Comment:
   Why is this assertion so certain, it may cause the test to become more 
unstable



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