Skip to content

Commit dad9801

Browse files
committed
MAPREDUCE-7517 TestPipeApplication hangs with JAVA 17+
1 parent 949c0d5 commit dad9801

File tree

1 file changed

+5
-1
lines changed
  • hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/pipes

1 file changed

+5
-1
lines changed

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/pipes/TestPipeApplication.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.util.List;
3636
import java.util.Map;
3737
import java.util.Map.Entry;
38+
import java.util.concurrent.TimeUnit;
3839

3940
import org.apache.hadoop.fs.CommonConfigurationKeys;
4041
import org.apache.hadoop.fs.FileSystem;
@@ -69,12 +70,15 @@
6970
import org.apache.hadoop.util.Progressable;
7071
import org.apache.hadoop.yarn.security.AMRMTokenIdentifier;
7172
import org.junit.jupiter.api.Test;
73+
import org.junit.jupiter.api.Timeout;
7274

7375
import static org.junit.jupiter.api.Assertions.assertEquals;
7476
import static org.junit.jupiter.api.Assertions.assertNotNull;
7577
import static org.junit.jupiter.api.Assertions.assertTrue;
7678
import static org.junit.jupiter.api.Assertions.fail;
79+
import static org.junit.jupiter.api.Timeout.ThreadMode.SEPARATE_THREAD;
7780

81+
@Timeout(value=10, unit = TimeUnit.SECONDS, threadMode = SEPARATE_THREAD)
7882
public class TestPipeApplication {
7983
private static File workSpace = new File("target",
8084
TestPipeApplication.class.getName() + "-workSpace");
@@ -614,7 +618,7 @@ private File getFileCommand(String clazz) throws Exception {
614618
if (clazz == null) {
615619
os.write(("ls ").getBytes());
616620
} else {
617-
os.write(("java -cp " + classpath + " " + clazz).getBytes());
621+
os.write((System.getProperty("java.home") + "/bin/java -cp " + classpath + " " + clazz).getBytes());
618622
}
619623
os.flush();
620624
os.close();

0 commit comments

Comments
 (0)