|
@@ -30,6 +30,7 @@ import junit.framework.Assert;
|
|
|
import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
|
+import org.apache.hadoop.util.Shell;
|
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
|
import org.apache.hadoop.yarn.server.MiniYARNCluster;
|
|
|
import org.junit.AfterClass;
|
|
@@ -50,7 +51,7 @@ public class TestUnmanagedAMLauncher {
|
|
|
conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 128);
|
|
|
if (yarnCluster == null) {
|
|
|
yarnCluster = new MiniYARNCluster(
|
|
|
- TestUnmanagedAMLauncher.class.getName(), 1, 1, 1);
|
|
|
+ TestUnmanagedAMLauncher.class.getSimpleName(), 1, 1, 1);
|
|
|
yarnCluster.init(conf);
|
|
|
yarnCluster.start();
|
|
|
URL url = Thread.currentThread().getContextClassLoader()
|
|
@@ -93,7 +94,7 @@ public class TestUnmanagedAMLauncher {
|
|
|
return envClassPath;
|
|
|
}
|
|
|
|
|
|
- @Test(timeout=10000)
|
|
|
+ @Test(timeout=30000)
|
|
|
public void testDSShell() throws Exception {
|
|
|
String classpath = getTestRuntimeClasspath();
|
|
|
String javaHome = System.getenv("JAVA_HOME");
|
|
@@ -112,7 +113,8 @@ public class TestUnmanagedAMLauncher {
|
|
|
javaHome
|
|
|
+ "/bin/java -Xmx512m "
|
|
|
+ "org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster "
|
|
|
- + "--container_memory 128 --num_containers 1 --priority 0 --shell_command ls" };
|
|
|
+ + "--container_memory 128 --num_containers 1 --priority 0 "
|
|
|
+ + "--shell_command " + (Shell.WINDOWS ? "dir" : "ls") };
|
|
|
|
|
|
LOG.info("Initializing Launcher");
|
|
|
UnmanagedAMLauncher launcher = new UnmanagedAMLauncher(new Configuration(
|