use of org.apache.flink.runtime.scheduler.adaptive.allocator.TestingSlotAllocator in project flink by apache.
the class AdaptiveSchedulerTest method testTryToAssignSlotsReturnsNotPossibleIfExpectedResourcesAreNotAvailable.
@Test
public void testTryToAssignSlotsReturnsNotPossibleIfExpectedResourcesAreNotAvailable() throws Exception {
final TestingSlotAllocator slotAllocator = TestingSlotAllocator.newBuilder().setTryReserveResourcesFunction(ignored -> Optional.empty()).build();
final AdaptiveScheduler adaptiveScheduler = new AdaptiveSchedulerBuilder(createJobGraph(), mainThreadExecutor).setSlotAllocator(slotAllocator).build();
final CreatingExecutionGraph.AssignmentResult assignmentResult = adaptiveScheduler.tryToAssignSlots(CreatingExecutionGraph.ExecutionGraphWithVertexParallelism.create(new StateTrackingMockExecutionGraph(), new CreatingExecutionGraphTest.TestingVertexParallelism()));
assertThat(assignmentResult.isSuccess()).isFalse();
}
Aggregations