diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestNodeManagerShutdown.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestNodeManagerShutdown.java index 95c1c10..1d621ae 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestNodeManagerShutdown.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestNodeManagerShutdown.java @@ -149,8 +149,8 @@ public void testKillContainersOnShutdown() throws IOException, } public static void startContainer(NodeManager nm, ContainerId cId, - FileContext localFS, File scriptFileDir, File processStartFile) - throws IOException, YarnException { + FileContext localFS, File scriptFileDir, File processStartFile) + throws IOException, YarnException { File scriptFile = createUnhaltingScriptFile(cId, scriptFileDir, processStartFile); @@ -158,7 +158,7 @@ public static void startContainer(NodeManager nm, ContainerId cId, recordFactory.newRecordInstance(ContainerLaunchContext.class); NodeId nodeId = BuilderUtils.newNodeId("localhost", 1234); - + URL localResourceUri = ConverterUtils.getYarnUrlFromPath(localFS .makeQualified(new Path(scriptFile.getAbsolutePath()))); @@ -235,7 +235,7 @@ private YarnConfiguration createNMConfig() { */ private static File createUnhaltingScriptFile(ContainerId cId, File scriptFileDir, File processStartFile) throws IOException { - File scriptFile = new File(scriptFileDir, "scriptFile.sh"); + File scriptFile = Shell.appendScriptExtension(scriptFileDir, "scriptFile"); PrintWriter fileWriter = new PrintWriter(scriptFile); if (Shell.WINDOWS) { fileWriter.println("@echo \"Running testscript for delayed kill\"");