cmccabe commented on code in PR #12776:
URL: https://github.com/apache/kafka/pull/12776#discussion_r1013166571
##########
server-common/src/test/java/org/apache/kafka/queue/KafkaEventQueueTest.java:
##########
@@ -240,4 +242,29 @@ public void handleException(Throwable e) {
assertEquals(RejectedExecutionException.class, assertThrows(
ExecutionException.class, () ->
future.get()).getCause().getClass());
}
-}
+
+ @Test
+ public void testEmpty() throws Exception {
+ KafkaEventQueue queue = new KafkaEventQueue(Time.SYSTEM, new
LogContext(),
+ "testEmpty");
+ assertTrue(queue.isEmpty());
+ CompletableFuture<Void> future = new CompletableFuture<>();
+ queue.append(() -> future.get());
+ assertFalse(queue.isEmpty());
Review Comment:
This had a bug, which is that it wasn't taking into account the currently
running event in its calculation of "empty". I fixed this bug and the test
should be working now. I don't think we need the waits (except in the one
position)
--
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]