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


##########
flink-runtime/src/test/java/org/apache/flink/runtime/testutils/TestingJobResultStore.java:
##########
@@ -80,33 +82,65 @@ private TestingJobResultStore(
     }
 
     @Override
-    public void createDirtyResult(JobResultEntry jobResultEntry) throws 
IOException {
-        createDirtyResultConsumer.accept(jobResultEntry);
+    public CompletableFuture<Void> createDirtyResultAsync(JobResultEntry 
jobResultEntry) {
+        try {
+            createDirtyResultConsumer.accept(jobResultEntry);
+        } catch (IOException e) {
+            CompletableFuture<Void> future = new CompletableFuture<>();
+            future.completeExceptionally(e);
+            return future;
+        }
+        return CompletableFuture.completedFuture(null);
     }
 
     @Override
-    public void markResultAsClean(JobID jobId) throws IOException {
-        markResultAsCleanConsumer.accept(jobId);
+    public CompletableFuture<Void> markResultAsCleanAsync(JobID jobId) {
+        try {
+            markResultAsCleanConsumer.accept(jobId);
+        } catch (IOException e) {

Review Comment:
   You're not following the contract here, I guess. :thinking: Usually for 
these `Testing*` implementations, we would change the callback type (e.g. a 
`ThrowingConsumer<T>` becomes a `Function<T, CompletableFuture<Void>`). That 
enables us to have the entire logic being specified in the test method.



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