lizhanhui commented on code in PR #5397:
URL: https://github.com/apache/rocketmq/pull/5397#discussion_r1003957435


##########
store/src/test/java/org/apache/rocketmq/store/ConsumeQueueTest.java:
##########
@@ -250,7 +250,11 @@ public void testPutMessagePositionInfo_buildCQRepeatedly() 
throws Exception {
             for (int i = 0; i < totalMessages; i++) {
                 putMsg(messageStore);
             }
-            Thread.sleep(5);
+
+            // Wait consume queue build finish.
+            while (messageStore.dispatchBehindBytes() > 0) {

Review Comment:
   5 seconds is pretty long duration... Best to use awaitability to use finer  
granularity.
   
    Awaitility.with().pollInterval(100, TimeUnit.MILLISECONDS).await().until(() 
-> {
                   return store.dispatchBehindBytes() == 0;
               });



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