|
35 | 35 | import java.util.List;
|
36 | 36 | import java.util.Map;
|
37 | 37 | import java.util.Map.Entry;
|
| 38 | +import java.util.concurrent.TimeUnit; |
38 | 39 |
|
39 | 40 | import org.apache.hadoop.fs.CommonConfigurationKeys;
|
40 | 41 | import org.apache.hadoop.fs.FileSystem;
|
|
69 | 70 | import org.apache.hadoop.util.Progressable;
|
70 | 71 | import org.apache.hadoop.yarn.security.AMRMTokenIdentifier;
|
71 | 72 | import org.junit.jupiter.api.Test;
|
| 73 | +import org.junit.jupiter.api.Timeout; |
72 | 74 |
|
73 | 75 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
74 | 76 | import static org.junit.jupiter.api.Assertions.assertNotNull;
|
75 | 77 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
76 | 78 | import static org.junit.jupiter.api.Assertions.fail;
|
| 79 | +import static org.junit.jupiter.api.Timeout.ThreadMode.SEPARATE_THREAD; |
77 | 80 |
|
| 81 | +@Timeout(value=10, unit = TimeUnit.SECONDS, threadMode = SEPARATE_THREAD) |
78 | 82 | public class TestPipeApplication {
|
79 | 83 | private static File workSpace = new File("target",
|
80 | 84 | TestPipeApplication.class.getName() + "-workSpace");
|
@@ -614,7 +618,8 @@ private File getFileCommand(String clazz) throws Exception {
|
614 | 618 | if (clazz == null) {
|
615 | 619 | os.write(("ls ").getBytes());
|
616 | 620 | } else {
|
617 |
| - os.write(("java -cp " + classpath + " " + clazz).getBytes()); |
| 621 | + // On Java 8 java.home returns "${JAVA_HOME}/jre", but that's good enough for this test |
| 622 | + os.write((System.getProperty("java.home") + "/bin/java -cp " + classpath + " " + clazz).getBytes()); |
618 | 623 | }
|
619 | 624 | os.flush();
|
620 | 625 | os.close();
|
|
0 commit comments