use of org.apache.flink.runtime.jobmaster.SlotRequestId in project flink by apache.
the class PhysicalSlotRequestBulkCheckerImplTest method testFulfilledBulkIsNotCancelled.
@Test
public void testFulfilledBulkIsNotCancelled() throws InterruptedException, ExecutionException {
final CompletableFuture<SlotRequestId> cancellationFuture = new CompletableFuture<>();
final PhysicalSlotRequestBulk bulk = createPhysicalSlotRequestBulkWithCancellationFuture(cancellationFuture, new SlotRequestId());
bulkChecker.schedulePendingRequestBulkTimeoutCheck(bulk, TIMEOUT);
checkNotCancelledAfter(cancellationFuture, 2 * TIMEOUT.toMilliseconds());
}
use of org.apache.flink.runtime.jobmaster.SlotRequestId in project flink by apache.
the class PhysicalSlotRequestBulkCheckerImplTest method testBulkFulfillable.
@Test
public void testBulkFulfillable() {
final PhysicalSlotRequestBulk bulk = createPhysicalSlotRequestBulk(new SlotRequestId());
addOneSlot();
assertThat(isFulfillable(bulk), is(true));
}
use of org.apache.flink.runtime.jobmaster.SlotRequestId in project flink by apache.
the class PhysicalSlotRequestBulkCheckerImplTest method testPendingBulkIsNotCancelled.
@Test
public void testPendingBulkIsNotCancelled() throws InterruptedException, ExecutionException {
final CompletableFuture<SlotRequestId> cancellationFuture = new CompletableFuture<>();
final PhysicalSlotRequestBulk bulk = createPhysicalSlotRequestBulkWithCancellationFuture(cancellationFuture, new SlotRequestId());
bulkChecker.schedulePendingRequestBulkTimeoutCheck(bulk, TIMEOUT);
checkNotCancelledAfter(cancellationFuture, 2 * TIMEOUT.toMilliseconds());
}
use of org.apache.flink.runtime.jobmaster.SlotRequestId in project flink by apache.
the class PhysicalSlotRequestBulkCheckerImplTest method testUnfulfillableBulkIsCancelled.
@Test
public void testUnfulfillableBulkIsCancelled() {
final CompletableFuture<SlotRequestId> cancellationFuture = new CompletableFuture<>();
final SlotRequestId slotRequestId = new SlotRequestId();
final PhysicalSlotRequestBulk bulk = createPhysicalSlotRequestBulkWithCancellationFuture(cancellationFuture, slotRequestId);
bulkChecker.schedulePendingRequestBulkTimeoutCheck(bulk, TIMEOUT);
clock.advanceTime(TIMEOUT.toMilliseconds() + 1L, TimeUnit.MILLISECONDS);
assertThat(cancellationFuture.join(), is(slotRequestId));
}
use of org.apache.flink.runtime.jobmaster.SlotRequestId in project flink by apache.
the class PhysicalSlotRequestBulkCheckerImplTest method testBulkFulfillableWithSlotOccupiedTemporarily.
@Test
public void testBulkFulfillableWithSlotOccupiedTemporarily() {
final PhysicalSlotRequestBulk bulk = createPhysicalSlotRequestBulk(new SlotRequestId(), new SlotRequestId());
final PhysicalSlot slot1 = addOneSlot();
addOneSlot();
occupyPhysicalSlot(slot1, false);
assertThat(isFulfillable(bulk), is(true));
}
Aggregations