tillrohrmann commented on a change in pull request #11353: [FLINK-16438][yarn] Make YarnResourceManager starts workers using WorkerResourceSpec requested by SlotManager URL: https://github.com/apache/flink/pull/11353#discussion_r404123445
########## File path: flink-kubernetes/src/test/java/org/apache/flink/kubernetes/KubernetesResourceManagerTest.java ########## @@ -321,6 +339,47 @@ public void testGetCpuCoresNumSlots() { assertThat(resourceManager.getCpuCores(configuration), is(3.0)); } + @Test + public void testStartAndRecoverVariousResourceSpec() { + // Start two workers with different resources + final WorkerResourceSpec workerResourceSpec1 = new WorkerResourceSpec(1.0, 100, 0, 100, 100); + final WorkerResourceSpec workerResourceSpec2 = new WorkerResourceSpec(1.0, 99, 0, 100, 100); + resourceManager.startNewWorker(workerResourceSpec1); + resourceManager.startNewWorker(workerResourceSpec2); + + // Verify two pods with both worker resources are started + final PodList initialPodList = kubeClient.pods().list(); + assertEquals(2, initialPodList.getItems().size()); + final Pod initialPod1 = getPodContainsStrInArgs(initialPodList, TaskManagerOptions.TASK_HEAP_MEMORY.key() + "=" + (100L << 20)); + final Pod initialPod2 = getPodContainsStrInArgs(initialPodList, TaskManagerOptions.TASK_HEAP_MEMORY.key() + "=" + (99L << 20)); + + // Notify resource manager about pods added. + final KubernetesPod initialKubernetesPod1 = new KubernetesPod(initialPod1); + final KubernetesPod initialKubernetesPod2 = new KubernetesPod(initialPod2); + resourceManager.onAdded(ImmutableList.of(initialKubernetesPod1, initialKubernetesPod2)); + + // Terminate pod1. + terminatePod(initialPod1); + resourceManager.setCustomPendingWorkerNums(Collections.singletonMap(workerResourceSpec1, 1)); Review comment: This sounds good. ---------------------------------------------------------------- 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 With regards, Apache Git Services