chia7712 commented on code in PR #17957:
URL: https://github.com/apache/kafka/pull/17957#discussion_r1864994533


##########
core/src/test/java/kafka/server/share/SharePartitionTest.java:
##########
@@ -490,11 +490,14 @@ public void 
testMaybeInitializeSharePartitionAgainConcurrentRequests() throws In
             if (!executorService.awaitTermination(30, TimeUnit.MILLISECONDS))
                 executorService.shutdown();
         }
+        int futuresCompleted = 0;
 
         for (CompletableFuture<Void> result : results) {
             assertTrue(result.isDone());
-            assertFalse(result.isCompletedExceptionally());
+            if (!result.isCompletedExceptionally())

Review Comment:
   Maybe we can simplify the code by lambda?
   ```
           assertTrue(results.stream().allMatch(CompletableFuture::isDone));
           
assertFalse(results.stream().allMatch(CompletableFuture::isCompletedExceptionally));
   ```



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