Search in sources :

Example 16 with TestingPhysicalSlot

use of org.apache.flink.runtime.scheduler.TestingPhysicalSlot in project flink by apache.

the class SharedSlotTest method testReleaseForbidsSubsequentLogicalSlotAllocations.

@Test(expected = IllegalStateException.class)
public void testReleaseForbidsSubsequentLogicalSlotAllocations() {
    final TestingPhysicalSlot physicalSlot = TestingPhysicalSlot.builder().build();
    final SharedSlot sharedSlot = new SharedSlot(new SlotRequestId(), physicalSlot, false, () -> {
    });
    sharedSlot.release(new Exception("test"));
    sharedSlot.allocateLogicalSlot();
}
Also used : SlotRequestId(org.apache.flink.runtime.jobmaster.SlotRequestId) TestingPhysicalSlot(org.apache.flink.runtime.scheduler.TestingPhysicalSlot) Test(org.junit.Test)

Aggregations

TestingPhysicalSlot (org.apache.flink.runtime.scheduler.TestingPhysicalSlot)16 Test (org.junit.Test)15 SlotRequestId (org.apache.flink.runtime.jobmaster.SlotRequestId)13 LogicalSlot (org.apache.flink.runtime.jobmaster.LogicalSlot)8 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 CompletableFuture (java.util.concurrent.CompletableFuture)3 JobVertex (org.apache.flink.runtime.jobgraph.JobVertex)3 TestingLogicalSlotBuilder (org.apache.flink.runtime.jobmaster.TestingLogicalSlotBuilder)3 TestingPhysicalSlotPayload (org.apache.flink.runtime.jobmaster.slotpool.TestingPhysicalSlotPayload)3 SchedulerBase (org.apache.flink.runtime.scheduler.SchedulerBase)3 TestingPhysicalSlotProvider (org.apache.flink.runtime.scheduler.TestingPhysicalSlotProvider)3 Consumer (java.util.function.Consumer)2 AllocationID (org.apache.flink.runtime.clusterframework.types.AllocationID)2 JobGraph (org.apache.flink.runtime.jobgraph.JobGraph)2 Locality (org.apache.flink.runtime.jobmanager.scheduler.Locality)2 TaskManagerLocation (org.apache.flink.runtime.taskmanager.TaskManagerLocation)2 TestLogger (org.apache.flink.util.TestLogger)2 CoreMatchers.equalTo (org.hamcrest.CoreMatchers.equalTo)2 CoreMatchers.is (org.hamcrest.CoreMatchers.is)2 CoreMatchers.not (org.hamcrest.CoreMatchers.not)2