satishd commented on code in PR #17214:
URL: https://github.com/apache/kafka/pull/17214#discussion_r1764326527


##########
core/src/test/java/kafka/log/remote/RemoteLogOffsetReaderTest.java:
##########
@@ -111,18 +111,20 @@ public void testTaskQueueFullAndCancelTask() throws 
Exception {
         holderList.get(2).jobFuture().cancel(false);
 
         rlm.resume();
-        AsyncOffsetReadFutureHolder<Either<Exception, 
Option<TimestampAndOffset>>> last = holderList.get(holderList.size() - 1);
-        last.taskFuture().get(100, TimeUnit.MILLISECONDS);
-
-        assertEquals(12, holderList.size());
-        assertEquals(11, holderList.stream().filter(h -> 
h.taskFuture().isDone()).count());
+        for (AsyncOffsetReadFutureHolder<Either<Exception, 
Option<TimestampAndOffset>>> holder : holderList) {
+            if (!holder.jobFuture().isCancelled()) {
+                holder.taskFuture().get(1, TimeUnit.SECONDS);
+            }
+        }
+        assertEquals(5, holderList.size());
+        assertEquals(4, holderList.stream().filter(h -> 
h.taskFuture().isDone()).count());
         assertEquals(1, holderList.stream().filter(h -> 
!h.taskFuture().isDone()).count());
     }
 
     @Test
     public void testThrowErrorOnFindOffsetByTimestamp() throws Exception {
         RemoteStorageException exception = new RemoteStorageException("Error");
-        try (RemoteLogManager rlm = new MockRemoteLogManager(2, 10, 
logDir.toString()) {
+        try (RemoteLogManager rlm = new MockRemoteLogManager(2, 3, 
logDir.toString()) {

Review Comment:
   is there any reason to change it to 3? We are only submitting one async 
task, it needs to be at least 1. 



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

Reply via email to