You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/05/12 02:00:13 UTC
[GitHub] [flink] KarmaGYZ commented on a change in pull request #15887: [FLINK-22618][runtime] Fix incorrect free resource metrics of task ma…
KarmaGYZ commented on a change in pull request #15887:
URL: https://github.com/apache/flink/pull/15887#discussion_r630664117
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/FineGrainedSlotManagerTest.java
##########
@@ -737,6 +739,73 @@ public void testMaxTotalResourceCpuExceeded() throws Exception {
testMaxTotalResourceExceededRegisterResource(maxTotalResourceSetter);
}
+ @Test
+ public void testGetResourceOverview() throws Exception {
+ final TaskExecutorGateway taskExecutorGateway =
+ new TestingTaskExecutorGatewayBuilder().createTestingTaskExecutorGateway();
+ final ResourceID resourceId1 = ResourceID.generate();
+ final ResourceID resourceId2 = ResourceID.generate();
+ final TaskExecutorConnection taskManagerConnection1 =
Review comment:
We can use the `FineGrainedSlotManagerTestBase#createTaskExecutorConnection`
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/FineGrainedSlotManagerTest.java
##########
@@ -737,6 +739,73 @@ public void testMaxTotalResourceCpuExceeded() throws Exception {
testMaxTotalResourceExceededRegisterResource(maxTotalResourceSetter);
}
+ @Test
+ public void testGetResourceOverview() throws Exception {
+ final TaskExecutorGateway taskExecutorGateway =
+ new TestingTaskExecutorGatewayBuilder().createTestingTaskExecutorGateway();
+ final ResourceID resourceId1 = ResourceID.generate();
+ final ResourceID resourceId2 = ResourceID.generate();
+ final TaskExecutorConnection taskManagerConnection1 =
+ new TaskExecutorConnection(resourceId1, taskExecutorGateway);
+ final TaskExecutorConnection taskManagerConnection2 =
+ new TaskExecutorConnection(resourceId2, taskExecutorGateway);
+
+ final SlotID slotId1 = new SlotID(resourceId1, 0);
+ final SlotID slotId2 = new SlotID(resourceId1, 1);
+ final SlotID slotId3 = new SlotID(resourceId2, 0);
+ final SlotID slotId4 = new SlotID(resourceId2, 1);
+ final ResourceProfile resourceProfile1 = ResourceProfile.fromResources(1, 10);
+ final ResourceProfile resourceProfile2 = ResourceProfile.fromResources(2, 20);
+ final SlotStatus slotStatus1 = new SlotStatus(slotId1, resourceProfile1);
Review comment:
There is no need to add non-allocated slot status here.
--
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:
users@infra.apache.org