XComp commented on code in PR #20684:
URL: https://github.com/apache/flink/pull/20684#discussion_r955768201


##########
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/highavailability/KubernetesStateHandleStoreTest.java:
##########
@@ -1208,14 +1208,16 @@ private static CompletableFuture<Boolean> 
retryWithFirstFailedK8sOperation(
                                                                 + "kubernetes 
client operation");
                                             }
                                             return true;
-                                        }),
+                                        },
+                                        Executors.newDirectExecutorService()),
                         
KubernetesConfigOptions.KUBERNETES_TRANSACTIONAL_OPERATION_MAX_RETRIES
                                 .defaultValue(),
                         t ->
                                 ExceptionUtils.findThrowable(t, 
KubernetesClientException.class)
                                         .isPresent(),
                         Executors.newDirectExecutorService());
         assertThat(callbackInvocationCount.get()).isEqualTo(2);
+        assertThat(result.isDone()).isTrue();

Review Comment:
   ```suggestion
           assertThat(result).isCompleted();
   ```
   But that said, we can go for a stricter assert here. Check for completion is 
what we want. `isDone()` would also cover completed exceptionally cases.



##########
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/highavailability/KubernetesStateHandleStoreTest.java:
##########
@@ -1208,14 +1208,16 @@ private static CompletableFuture<Boolean> 
retryWithFirstFailedK8sOperation(
                                                                 + "kubernetes 
client operation");
                                             }
                                             return true;
-                                        }),
+                                        },
+                                        Executors.newDirectExecutorService()),
                         
KubernetesConfigOptions.KUBERNETES_TRANSACTIONAL_OPERATION_MAX_RETRIES
                                 .defaultValue(),
                         t ->
                                 ExceptionUtils.findThrowable(t, 
KubernetesClientException.class)
                                         .isPresent(),
                         Executors.newDirectExecutorService());
         assertThat(callbackInvocationCount.get()).isEqualTo(2);
+        assertThat(result.isDone()).isTrue();

Review Comment:
   ```suggestion
           assertThat(result).isDone();
   ```
   nit: just as a fyi - assertj has also asserts for the `CompletableFuture` 
state. I really have no strong opinion on what looks better, though. ¯\_(ツ)_/¯



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

Reply via email to