Search in sources :

Example 51 with SlotRequestId

use of org.apache.flink.runtime.jobmaster.SlotRequestId 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

SlotRequestId (org.apache.flink.runtime.jobmaster.SlotRequestId)51 Test (org.junit.Test)40 TestingPhysicalSlot (org.apache.flink.runtime.scheduler.TestingPhysicalSlot)15 LogicalSlot (org.apache.flink.runtime.jobmaster.LogicalSlot)12 CompletableFuture (java.util.concurrent.CompletableFuture)11 AllocationID (org.apache.flink.runtime.clusterframework.types.AllocationID)11 ResourceProfile (org.apache.flink.runtime.clusterframework.types.ResourceProfile)8 TestLogger (org.apache.flink.util.TestLogger)6 Collectors (java.util.stream.Collectors)5 CoreMatchers.is (org.hamcrest.CoreMatchers.is)5 Assert.fail (org.junit.Assert.fail)5 Collection (java.util.Collection)4 Collections (java.util.Collections)4 List (java.util.List)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 Consumer (java.util.function.Consumer)4 Time (org.apache.flink.api.common.time.Time)4 Arrays (java.util.Arrays)3 ExecutionException (java.util.concurrent.ExecutionException)3 SlotProfile (org.apache.flink.runtime.clusterframework.types.SlotProfile)3