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


##########
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) {
+                Thread.sleep(5);
+            }

Review Comment:
   Waiting for the desired condition with a max time may be better, like 
`awaitility`.



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