Samrat002 commented on code in PR #25877: URL: https://github.com/apache/flink/pull/25877#discussion_r1901467485
########## flink-yarn/src/test/java/org/apache/flink/yarn/UtilsTest.java: ########## @@ -674,6 +679,27 @@ void testGenerateJvmOptsString() { Utils.IGNORE_UNRECOGNIZED_VM_OPTIONS)); } + @Test + void testGetTaskManagerEnvsWithJavaHomeSet() { + final Configuration cfg = new Configuration(); + cfg.set(CoreOptions.FLINK_JAVA_HOME, "/opt/jdk"); + cfg.setString(CONTAINERIZED_TASK_MANAGER_ENV_PREFIX + "key", "val"); + final ContaineredTaskManagerParameters containeredParams = + ContaineredTaskManagerParameters.create(cfg, TASK_EXECUTOR_PROCESS_SPEC); + final Map<String, String> envVars = containeredParams.taskManagerEnv(); + assertThat(envVars).containsEntry(ENV_JAVA_HOME, "/opt/jdk").containsEntry("key", "val"); + } + + @Test + void testGetTaskManagerEnvsWithoutJavaHomeSet() { + final Configuration cfg = new Configuration(); + cfg.setString(CONTAINERIZED_TASK_MANAGER_ENV_PREFIX + "key", "val"); Review Comment: ```suggestion cfg.setString("{}-key".formatted(CONTAINERIZED_TASK_MANAGER_ENV_PREFIX ), "val"); ``` ########## flink-yarn/src/test/java/org/apache/flink/yarn/UtilsTest.java: ########## @@ -56,6 +59,19 @@ class UtilsTest { private static final String YARN_RM_ARBITRARY_SCHEDULER_CLAZZ = "org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler"; + private static final TaskExecutorProcessSpec TASK_EXECUTOR_PROCESS_SPEC = Review Comment: Why is the `taskExecutorProcessSpec` variable moved to an instance variable for the class? Currently, it doesn’t seem to be needed outside the `testGetTaskManagerShellCommand` method. It would be better to keep it as a local variable. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org