zhuzhurk commented on a change in pull request #12278: URL: https://github.com/apache/flink/pull/12278#discussion_r441431939
########## 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); Review comment: You are right. I have dropped scheduler in the newly added cases. However, this unnecessary complication is a common problem of most of the SlotPool tests. I think we can simplify them in a separate task as well. ---------------------------------------------------------------- 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