adixitconfluent commented on code in PR #17957:
URL: https://github.com/apache/kafka/pull/17957#discussion_r1865006610
##########
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:
Hi @chia7712 , yes, if not for the change, this test would become highly
flaky.
> Maybe we can simplify the code by lambda?
>
> ```
> assertTrue(results.stream().allMatch(CompletableFuture::isDone));
>
assertFalse(results.stream().allMatch(CompletableFuture::isCompletedExceptionally));
> ```
Made this change. Please review the PR. Thanks!
--
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]