azagrebin commented on a change in pull request #6734: [FLINK-9455][RM] Add
support for multi task slot TaskExecutors
URL: https://github.com/apache/flink/pull/6734#discussion_r220133632
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerTest.java
##########
@@ -544,21 +544,17 @@ public void
testDuplicatePendingSlotRequestAfterSuccessfulAllocation() throws Ex
@Test
public void testAcceptingDuplicateSlotRequestAfterAllocationRelease()
throws Exception {
final ResourceManagerId resourceManagerId =
ResourceManagerId.generate();
- final ResourceActions resourceManagerActions =
mock(ResourceActions.class);
+ final AtomicInteger allocateResourceCalls = new
AtomicInteger(0);
+ final ResourceActions resourceManagerActions = new
TestingResourceActionsBuilder()
+ .setAllocateResourceConsumer(resourceProfile ->
allocateResourceCalls.incrementAndGet())
Review comment:
the logic of some of this built TestingResourceActions repeat in some
places, we could create some standard factory methods for them (maybe in
future), e.g.:
```
resourceManagerActions =
TestingResourceActionsBuilder.createAllocatingFixedSlotsResource(numOfSlotsPerWorker);
allocateResourceCalls = resourceManagerActions.getAllocationsCounter();
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services