StefanRRichter commented on a change in pull request #7568: [FLINK-11417] Make 
access to ExecutionGraph single threaded from JobMaster main thread
URL: https://github.com/apache/flink/pull/7568#discussion_r252699265
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionTest.java
 ##########
 @@ -478,22 +489,25 @@ public void testEagerSchedulingFailureReturnsSlot() 
throws Exception {
                                                slotRequestId);
                                        slotProvider.complete(slotRequestId, 
singleLogicalSlot);
                                },
-                               executorService);
-
-                       final CompletableFuture<Void> schedulingFuture = 
execution.scheduleForExecution(
-                               slotProvider,
-                               false,
-                               LocationPreferenceConstraint.ANY,
-                               Collections.emptySet());
-
-                       try {
-                               schedulingFuture.get();
-                               // cancel the execution in case we could 
schedule the execution
-                               execution.cancel();
-                       } catch (ExecutionException ignored) {
-                       }
-
-                       assertThat(returnedSlotFuture.get(), 
is(equalTo(slotRequestIdFuture.get())));
+                               executorService).thenRunAsync(() -> {
+                                       try {
+                                               final CompletableFuture<Void> 
schedulingFuture = execution.scheduleForExecution(
+                                                       slotProvider,
+                                                       false,
+                                                       
LocationPreferenceConstraint.ANY,
+                                                       Collections.emptySet());
+
+                                               try {
+                                                       schedulingFuture.get();
+                                                       // cancel the execution 
in case we could schedule the execution
+                                                       execution.cancel();
+                                               } catch (ExecutionException 
ignored) {
+                                               }
+
+                                               
assertThat(returnedSlotFuture.get(), is(equalTo(slotRequestIdFuture.get())));
+                                       } catch (Exception ex) {
+                                       }
+                       }, testMainThreadUtil.getMainThreadExecutor());
 
 Review comment:
   I think it is not that easy because there is curently no way to complete the 
future after scheduling took the failing branch without using another thread.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to