hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1079205 - /hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/
Date Tue, 08 Mar 2011 05:55:34 GMT
Author: omalley
Date: Tue Mar  8 05:55:33 2011
New Revision: 1079205

URL: http://svn.apache.org/viewvc?rev=1079205&view=rev
Log:
commit 56c698d34c7e51cc7cfb66a67035dc14291f36f8
Author: Luke Lu <llu@yahoo-inc.com>
Date:   Tue Dec 7 14:15:23 2010 -0800

    Fix unit tests now that MiniDFSCluster is unhanged

Modified:
    hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java
    hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java
    hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java
    hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java
    hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRDFSSort.java
    hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerInstrumentation.java
    hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
    hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java

Modified: hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java?rev=1079205&r1=1079204&r2=1079205&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/FakeObjectUtilities.java
Tue Mar  8 05:55:33 2011
@@ -34,6 +34,7 @@ import org.apache.hadoop.mapreduce.jobhi
 import org.apache.hadoop.mapreduce.jobhistory.JobHistory;
 import org.apache.hadoop.mapreduce.split.JobSplit;
 import org.apache.hadoop.mapreduce.split.JobSplit.TaskSplitMetaInfo;
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
 
 /** 
  * Utilities used in unit test.
@@ -41,6 +42,8 @@ import org.apache.hadoop.mapreduce.split
  */
 public class FakeObjectUtilities {
 
+  static { DefaultMetricsSystem.setMiniClusterMode(true); }
+
   static final Log LOG = LogFactory.getLog(FakeObjectUtilities.class);
 
   private static String jtIdentifier = "test";

Modified: hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java?rev=1079205&r1=1079204&r2=1079205&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java
Tue Mar  8 05:55:33 2011
@@ -67,7 +67,7 @@ public class MiniMRCluster {
   private JobConf job;
   private Clock clock;
 
-  { DefaultMetricsSystem.setMiniClusterMode(true); }
+  static { DefaultMetricsSystem.setMiniClusterMode(true); }
   
   /**
    * An inner class that runs a job tracker.

Modified: hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java?rev=1079205&r1=1079204&r2=1079205&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestJobInProgress.java
Tue Mar  8 05:55:33 2011
@@ -323,7 +323,7 @@ public class TestJobInProgress extends T
 
     verify(jspy).getStatus();
     verify(jspy).getProfile();
-    verify(jspy).getJobCounters();
+    verify(jspy, atLeastOnce()).getJobCounters();
     verify(jspy, atLeastOnce()).getJobID();
     verify(jspy).getStartTime();
     verify(jspy).getFirstTaskLaunchTimes();

Modified: hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java?rev=1079205&r1=1079204&r2=1079205&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMRServerPorts.java
Tue Mar  8 05:55:33 2011
@@ -29,6 +29,7 @@ import org.apache.hadoop.mapreduce.serve
 import org.apache.hadoop.mapreduce.server.tasktracker.TTConfig;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
 
 /**
  * This test checks correctness of port usage by mapreduce components:
@@ -41,6 +42,9 @@ import org.apache.hadoop.fs.FileSystem;
  * a free port and start on it.
  */
 public class TestMRServerPorts extends TestCase {
+
+  static { DefaultMetricsSystem.setMiniClusterMode(true); }
+
   TestHDFSServerPorts hdfs = new TestHDFSServerPorts();
 
   // Runs the JT in a separate thread

Modified: hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRDFSSort.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRDFSSort.java?rev=1079205&r1=1079204&r2=1079205&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRDFSSort.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRDFSSort.java
Tue Mar  8 05:55:33 2011
@@ -39,6 +39,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.hadoop.examples.RandomWriter;
 import org.apache.hadoop.examples.Sort;
+import org.apache.hadoop.mapreduce.FileSystemCounter;
 
 /**
  * A JUnit test to test the Map-Reduce framework's sort 
@@ -105,8 +106,8 @@ public class TestMiniMRDFSSort extends T
       org.apache.hadoop.mapreduce.lib.input.FileInputFormat.COUNTER_GROUP,
       org.apache.hadoop.mapreduce.lib.input.FileInputFormat.BYTES_READ).
       getValue();
-    long hdfsRead = counters.findCounter(Task.FILESYSTEM_COUNTER_GROUP,
-                                         "HDFS_BYTES_READ").getValue();
+    long hdfsRead = counters.findCounter("HDFS", FileSystemCounter.BYTES_READ)
+                            .getValue();
     // the hdfs read should be between 100% and 110% of the map input bytes
     assertTrue("map input = " + mapInput + ", hdfs read = " + hdfsRead,
                (hdfsRead < (mapInput * 1.1)) &&

Modified: hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerInstrumentation.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerInstrumentation.java?rev=1079205&r1=1079204&r2=1079205&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerInstrumentation.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerInstrumentation.java
Tue Mar  8 05:55:33 2011
@@ -28,8 +28,12 @@ import static org.junit.Assert.*;
 
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapreduce.server.tasktracker.TTConfig;
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
 
 public class TestTaskTrackerInstrumentation {
+
+  static { DefaultMetricsSystem.setMiniClusterMode(true); }
+
   private static final Log LOG = LogFactory.getLog(
       TestTaskTrackerInstrumentation.class);
 

Modified: hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java?rev=1079205&r1=1079204&r2=1079205&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
Tue Mar  8 05:55:33 2011
@@ -54,6 +54,7 @@ import org.apache.hadoop.mapred.TaskTrac
 import org.apache.hadoop.mapred.UtilsForTests.InlineCleanupQueue;
 
 import junit.framework.TestCase;
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
 
 /**
  * Test to verify localization of a job and localization of a task on a
@@ -62,6 +63,8 @@ import junit.framework.TestCase;
  */
 public class TestTaskTrackerLocalization extends TestCase {
 
+  static { DefaultMetricsSystem.setMiniClusterMode(true); }
+
   private static File TEST_ROOT_DIR = 
     new File(System.getProperty("test.build.data", "/tmp"));
   private File ROOT_MAPRED_LOCAL_DIR;

Modified: hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java?rev=1079205&r1=1079204&r2=1079205&view=diff
==============================================================================
--- hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java
(original)
+++ hadoop/mapreduce/branches/yahoo-merge/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java
Tue Mar  8 05:55:33 2011
@@ -50,7 +50,7 @@ import org.apache.hadoop.io.SequenceFile
 import org.apache.hadoop.mapred.SortValidator.RecordStatsChecker.NonSplitableSequenceFileInputFormat;
 import org.apache.hadoop.mapred.lib.IdentityMapper;
 import org.apache.hadoop.mapred.lib.IdentityReducer;
-import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
 import org.apache.hadoop.util.StringUtils;
 
 import org.apache.commons.logging.Log;
@@ -73,6 +73,8 @@ public class UtilsForTests {
   static DecimalFormat dfm = new DecimalFormat("####.000");
   static DecimalFormat ifm = new DecimalFormat("###,###,###,###,###");
 
+  static { DefaultMetricsSystem.setMiniClusterMode(true); }
+
   public static String dfmt(double d) {
     return dfm.format(d);
   }



Mime
View raw message