Procházet zdrojové kódy

svn merge -c 1541566 FIXES: MAPREDUCE-5610. TestSleepJob fails in jdk7. Contributed by Jonathan Eagles

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1541590 13f79535-47bb-0310-9956-ffa450edef68
Jason Darrell Lowe před 11 roky
rodič
revize
f6e41cf254

+ 2 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -77,6 +77,8 @@ Release 0.23.10 - UNRELEASED
     MAPREDUCE-5561. org.apache.hadoop.mapreduce.v2.app.job.impl.TestJobImpl
     testcase failing on trunk (Karthik Kambatla via jlowe)
 
+    MAPREDUCE-5610. TestSleepJob fails in jdk7 (Jonathan Eagles via jlowe)
+
 Release 0.23.9 - 2013-07-08
 
   INCOMPATIBLE CHANGES

+ 2 - 2
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();

+ 11 - 11
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=100000)
-  public void testRandomLocation() throws Exception {
-    UserGroupInformation ugi = UserGroupInformation.getLoginUser();
-
-    testRandomLocation(1, 10, ugi);
-    testRandomLocation(2, 10, ugi);
-  }
-
   @Test (timeout=500000)
   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=100000)
+  public void testRandomLocation() throws Exception {
+    UserGroupInformation ugi = UserGroupInformation.getLoginUser();
+
+    testRandomLocation(1, 10, ugi);
+    testRandomLocation(2, 10, ugi);
+  }
+
   // test Serial submit
   @Test (timeout=500000)
   public void testSerialSubmit() throws Exception {