tillrohrmann commented on a change in pull request #7662: [FLINK-10431] 
Extraction of scheduling-related code from SlotPool into preliminary Scheduler 
(rebased)
URL: https://github.com/apache/flink/pull/7662#discussion_r256851648
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionVertexSchedulingTest.java
 ##########
 @@ -58,14 +69,21 @@ public void testSlotReleasedWhenScheduledImmediately() {
 
                        CompletableFuture<LogicalSlot> future = new 
CompletableFuture<>();
                        future.complete(slot);
+                       Scheduler scheduler = new TestingScheduler() {
+                               @Override
+                               public CompletableFuture<LogicalSlot> 
allocateSlot(
+                                       SlotRequestId slotRequestId,
+                                       ScheduledUnit scheduledUnit,
+                                       SlotProfile slotProfile,
+                                       boolean allowQueuedScheduling,
+                                       Time allocationTimeout) {
+                                       return future;
+                               }
+                       };
 
                        assertEquals(ExecutionState.CREATED, 
vertex.getExecutionState());
                        // try to deploy to the slot
-                       vertex.scheduleForExecution(
-                               new TestingSlotProvider(ignore -> future),
-                               false,
-                               LocationPreferenceConstraint.ALL,
-                               Collections.emptySet());
+                       vertex.scheduleForExecution(scheduler, false, 
LocationPreferenceConstraint.ALL, Collections.emptySet());
 
 Review comment:
   This can be done easier by replacing `scheduler` with `new 
TestingSlotProvider(ignored -> future)`.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to