Skip to content

Commit 92741d0

Browse files
Fix unit tests
1 parent e467176 commit 92741d0

File tree

2 files changed

+4
-1
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src

2 files changed

+4
-1
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ public void sanitizeEnv(Map<String, String> environment, Path pwd,
16651665
*
16661666
* @param environment The environment variables map to add the configuration values to.
16671667
*/
1668-
private void addConfigsToEnv(Map<String, String> environment) {
1668+
public void addConfigsToEnv(Map<String, String> environment) {
16691669
// variables here will be forced in, even if the container has
16701670
// specified them. Note: we do not track these in nmVars, to
16711671
// allow them to be ordered properly if they reference variables

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ public void handle(Event event) {
808808
resources.put(userjar, lpaths);
809809
Path nmp = new Path(testDir);
810810

811+
launch.addConfigsToEnv(userSetEnv);
811812
launch.sanitizeEnv(userSetEnv, pwd, appDirs, userLocalDirs, containerLogs,
812813
resources, nmp, nmEnvTrack);
813814
Assert.assertTrue(userSetEnv.containsKey("MALLOC_ARENA_MAX"));
@@ -864,6 +865,7 @@ public void handle(Event event) {
864865

865866
ContainerLaunch launch = new ContainerLaunch(distContext, conf,
866867
dispatcher, exec, null, container, dirsHandler, containerManager);
868+
launch.addConfigsToEnv(userSetEnv);
867869
launch.sanitizeEnv(userSetEnv, pwd, appDirs, userLocalDirs, containerLogs,
868870
resources, nmp, nmEnvTrack);
869871

@@ -876,6 +878,7 @@ public void handle(Event event) {
876878
containerLaunchContext.setEnvironment(userSetEnv);
877879
when(container.getLaunchContext()).thenReturn(containerLaunchContext);
878880

881+
launch.addConfigsToEnv(userSetEnv);
879882
launch.sanitizeEnv(userSetEnv, pwd, appDirs, userLocalDirs, containerLogs,
880883
resources, nmp, nmEnvTrack);
881884

0 commit comments

Comments
 (0)