Thesharing commented on a change in pull request #12917:
URL: https://github.com/apache/flink/pull/12917#discussion_r459819964



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImplTest.java
##########
@@ -275,16 +254,14 @@ public void testOfferSlot() throws Exception {
 
                
resourceManagerGateway.setRequestSlotConsumer(slotRequestFuture::complete);
 
-               try (SlotPoolImpl slotPool = createSlotPoolImpl()) {
-                       setupSlotPool(slotPool, resourceManagerGateway, 
mainThreadExecutor);
-                       Scheduler scheduler = setupScheduler(slotPool, 
mainThreadExecutor);
+               try (SlotPoolImpl slotPool = createAndSetUpSlotPool()) {
                        
slotPool.registerTaskManager(taskManagerLocation.getResourceID());
 
-                       CompletableFuture<LogicalSlot> future = 
scheduler.allocateSlot(
-                               new SlotRequestId(),
-                               new DummyScheduledUnit(),
-                               SlotProfile.noLocality(DEFAULT_TESTING_PROFILE),
-                               timeout);
+                       SlotRequestId requestId = new SlotRequestId();
+                       CompletableFuture<PhysicalSlot> future = 
requestNewAllocatedSlot(
+                               slotPool,
+                               requestId
+                       );

Review comment:
       It would be reused in `slotPool.releaseSlot(requestId, null)` in the 
line below.




----------------------------------------------------------------
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