mjsax commented on code in PR #17527: URL: https://github.com/apache/kafka/pull/17527#discussion_r1805673698
########## clients/src/test/java/org/apache/kafka/clients/MockClient.java: ########## @@ -336,6 +336,12 @@ public List<ClientResponse> poll(long timeoutMs, long now) { copy.add(response); } + if (copy.isEmpty()) { + // Simulate time advancing. If no responses are received, then we know that + // we waited for the whole timeoutMs. + time.sleep(timeoutMs); Review Comment: I guess most test don't expect that time advanced "automatically"... It think we need to remove this. I think there two possibilities: start a background thread in your test before you call `runOnce()` and let the background thread advance mockTime (maybe too complex?), or, make the `MockTime` object more advanced and add some "auto-time-advance" feature, ie, each time `milliseconds()` is called, advance time by 1ms (or some other value passed into MockTime -- only your test would enable this feature. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org