zhuzhurk commented on a change in pull request #12278:
URL: https://github.com/apache/flink/pull/12278#discussion_r441432435



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImplTest.java
##########
@@ -738,6 +740,95 @@ public void testCalculationOfTaskExecutorUtilization() 
throws Exception {
                }
        }
 
+       @Test
+       public void testOrphanedAllocationCanBeRemapped() throws Exception {
+               try (SlotPoolImpl slotPool = createSlotPoolImpl()) {
+                       final List<AllocationID> allocationIds = new 
ArrayList<>();
+                       resourceManagerGateway.setRequestSlotConsumer(
+                               slotRequest -> 
allocationIds.add(slotRequest.getAllocationId()));
+
+                       final List<AllocationID> canceledAllocations = new 
ArrayList<>();
+                       
resourceManagerGateway.setCancelSlotConsumer(canceledAllocations::add);
+
+                       setupSlotPool(slotPool, resourceManagerGateway, 
mainThreadExecutor);
+                       final Scheduler scheduler = setupScheduler(slotPool, 
mainThreadExecutor);
+
+                       final SlotRequestId slotRequestId1 = new 
SlotRequestId();
+                       scheduler.allocateSlot(
+                               slotRequestId1,
+                               new DummyScheduledUnit(),
+                               SlotProfile.noRequirements(),
+                               timeout);

Review comment:
       Done via introducing a `requestNewAllocatedSlots(SlotPool, 
SlotRequestId...)`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


Reply via email to