|
@@ -748,6 +748,12 @@ public class TestDistributedShell {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private String getSleepCommand(int sec) {
|
|
|
+ // Windows doesn't have a sleep command, ping -n does the trick
|
|
|
+ return Shell.WINDOWS ? "ping -n " + (sec + 1) + " 127.0.0.1 >nul"
|
|
|
+ : "sleep " + sec;
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void testDSRestartWithPreviousRunningContainers() throws Exception {
|
|
|
String[] args = {
|
|
@@ -756,7 +762,7 @@ public class TestDistributedShell {
|
|
|
"--num_containers",
|
|
|
"1",
|
|
|
"--shell_command",
|
|
|
- "sleep 8",
|
|
|
+ getSleepCommand(8),
|
|
|
"--master_memory",
|
|
|
"512",
|
|
|
"--container_memory",
|
|
@@ -791,7 +797,7 @@ public class TestDistributedShell {
|
|
|
"--num_containers",
|
|
|
"1",
|
|
|
"--shell_command",
|
|
|
- "sleep 8",
|
|
|
+ getSleepCommand(8),
|
|
|
"--master_memory",
|
|
|
"512",
|
|
|
"--container_memory",
|
|
@@ -829,7 +835,7 @@ public class TestDistributedShell {
|
|
|
"--num_containers",
|
|
|
"1",
|
|
|
"--shell_command",
|
|
|
- "sleep 8",
|
|
|
+ getSleepCommand(8),
|
|
|
"--master_memory",
|
|
|
"512",
|
|
|
"--container_memory",
|