wanglijie95 commented on code in PR #20056:
URL: https://github.com/apache/flink/pull/20056#discussion_r909314584
##########
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/kubeclient/decorators/InitTaskManagerDecoratorTest.java:
##########
@@ -178,12 +178,24 @@ void testMainContainerPorts() {
@Test
void testMainContainerEnv() {
- final Map<String, String> expectedEnvVars = new
HashMap<>(customizedEnvs);
+ final Map<String, String> envVars = new HashMap<>();
+ this.resultMainContainer
+ .getEnv()
+ .forEach(envVar -> envVars.put(envVar.getName(),
envVar.getValue()));
+ this.customizedEnvs.forEach((k, v) ->
assertThat(envVars.get(k)).isEqualTo(v));
- final Map<String, String> resultEnvVars =
- this.resultMainContainer.getEnv().stream()
- .collect(Collectors.toMap(EnvVar::getName,
EnvVar::getValue));
- expectedEnvVars.forEach((k, v) ->
assertThat(resultEnvVars.get(k)).isEqualTo(v));
Review Comment:
call `EnvVar::getValue` will return null on the newly added
`ENV_FLINK_POD_NODE_ID`, and then `Collectors.toMap` will throw a NPE.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]