You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/27 06:06:05 UTC

[GitHub] [pulsar] congbobo184 commented on a diff in pull request #17389: [fix][flaky-test]Fix PersistentSubscriptionMessageDispatchStreamingDispatcherThrottlingTest.testMultiLevelDispatch

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org