Author: vinodkv
Date: Sun Apr 13 19:55:57 2014
New Revision: 1587090

URL: http://svn.apache.org/r1587090
Log:
MAPREDUCE-5828. Fixed a test issue with TestMapReduceJobControl that was 
causing it to fail on Windows. Contributed by Vinod Kumar Vavilapalli.
svn merge --ignore-ancestry -c 1587089 ../../trunk/

Modified:
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt
    
hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt?rev=1587090&r1=1587089&r2=1587090&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt 
(original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt Sun 
Apr 13 19:55:57 2014
@@ -60,6 +60,9 @@ Release 2.4.1 - UNRELEASED
     on Windows for temporary files and thus also fix the test-issue with
     TestHistoryServerFileSystemStateStoreService. (Varun Vasudev via vinodkv)
 
+    MAPREDUCE-5828. Fixed a test issue with TestMapReduceJobControl that was
+    causing it to fail on Windows. (vinodkv)
+
 Release 2.4.0 - 2014-04-07 
 
   INCOMPATIBLE CHANGES

Modified: 
hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java?rev=1587090&r1=1587089&r2=1587090&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java
 (original)
+++ 
hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java
 Sun Apr 13 19:55:57 2014
@@ -24,6 +24,8 @@ import java.util.List;
 
 import junit.framework.Assert;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -38,6 +40,9 @@ import org.junit.Test;
  */
 public class TestMapReduceJobControl extends HadoopTestCase {
 
+  public static final Log LOG = 
+      LogFactory.getLog(TestMapReduceJobControl.class.getName());
+
   static Path rootDataDir = new Path(
     System.getProperty("test.build.data", "."), "TestData");
   static Path indir = new Path(rootDataDir, "indir");
@@ -117,6 +122,7 @@ public class TestMapReduceJobControl ext
   }
   
   public void testJobControlWithFailJob() throws Exception {
+    LOG.info("Starting testJobControlWithFailJob");
     Configuration conf = createJobConf();
 
     cleanupData(conf);
@@ -139,6 +145,8 @@ public class TestMapReduceJobControl ext
   }
 
   public void testJobControlWithKillJob() throws Exception {
+    LOG.info("Starting testJobControlWithKillJob");
+
     Configuration conf = createJobConf();
     cleanupData(conf);
     Job job1 = MapReduceTestUtil.createKillJob(conf, outdir_1, indir);
@@ -175,6 +183,8 @@ public class TestMapReduceJobControl ext
   }
 
   public void testJobControl() throws Exception {
+    LOG.info("Starting testJobControl");
+
     Configuration conf = createJobConf();
 
     cleanupData(conf);
@@ -193,10 +203,12 @@ public class TestMapReduceJobControl ext
   
   @Test(timeout = 30000)
   public void testControlledJob() throws Exception {
+    LOG.info("Starting testControlledJob");
+
     Configuration conf = createJobConf();
     cleanupData(conf);
     Job job1 = MapReduceTestUtil.createCopyJob(conf, outdir_1, indir);
-    createDependencies(conf, job1);
+    JobControl theControl = createDependencies(conf, job1);
     while (cjob1.getJobState() != ControlledJob.State.RUNNING) {
       try {
         Thread.sleep(100);
@@ -205,5 +217,10 @@ public class TestMapReduceJobControl ext
       }
     }
     Assert.assertNotNull(cjob1.getMapredJobId());
+
+    // wait till all the jobs complete
+    waitTillAllFinished(theControl);
+    assertEquals("Some jobs failed", 0, theControl.getFailedJobList().size());
+    theControl.stop();
   }
 }


Reply via email to