diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index ef2e6bf33ff..3f35f11bb33 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -70,6 +70,8 @@ Release 2.3.0 - UNRELEASED created by CombineFileInputFormat to fail (Robert Parker and Jason Lowe via jlowe) + MAPREDUCE-5610. TestSleepJob fails in jdk7 (Jonathan Eagles via jlowe) + Release 2.2.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/JobCreator.java b/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/JobCreator.java index f31e854ac01..c109e3fa3e2 100644 --- a/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/JobCreator.java +++ b/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/JobCreator.java @@ -63,8 +63,8 @@ public enum JobCreator { Configuration conf, long submissionMillis, JobStory jobdesc, Path outRoot, UserGroupInformation ugi, int seq) throws IOException { int numLocations = conf.getInt(SLEEPJOB_RANDOM_LOCATIONS, 0); - if (numLocations < 0) numLocations=0; - if ((numLocations > 0) && (hosts == null)) { + if (numLocations < 0) numLocations = 0; + if (hosts == null) { final JobClient client = new JobClient(new JobConf(conf)); ClusterStatus stat = client.getClusterStatus(true); final int nTrackers = stat.getTaskTrackers(); diff --git a/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestSleepJob.java b/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestSleepJob.java index 95b88258c0a..fe224ec6d80 100644 --- a/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestSleepJob.java +++ b/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestSleepJob.java @@ -58,17 +58,6 @@ public class TestSleepJob extends CommonJobTest { } - /* - * test RandomLocation - */ - @Test (timeout=600000) - public void testRandomLocation() throws Exception { - UserGroupInformation ugi = UserGroupInformation.getLoginUser(); - - testRandomLocation(1, 10, ugi); - testRandomLocation(2, 10, ugi); - } - @Test (timeout=600000) public void testMapTasksOnlySleepJobs() throws Exception { Configuration configuration = GridmixTestUtils.mrvl.getConfig(); @@ -90,6 +79,17 @@ public class TestSleepJob extends CommonJobTest { assertEquals(6, seq); } + /* + * test RandomLocation + */ + @Test (timeout=600000) + public void testRandomLocation() throws Exception { + UserGroupInformation ugi = UserGroupInformation.getLoginUser(); + + testRandomLocation(1, 10, ugi); + testRandomLocation(2, 10, ugi); + } + // test Serial submit @Test (timeout=600000) public void testSerialSubmit() throws Exception {