hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r814749 - in /hadoop/mapreduce/trunk: CHANGES.txt build.xml src/test/mapred/org/apache/hadoop/mapred/TestMiniMRChildTask.java
Date Mon, 14 Sep 2009 17:33:58 GMT
Author: mahadev
Date: Mon Sep 14 17:33:57 2009
New Revision: 814749

URL: http://svn.apache.org/viewvc?rev=814749&view=rev
Log:
MAPREDUCE-839. unit test TestMiniMRChildTask fails on mac os-x (hong tang via mahadev)

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/build.xml
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRChildTask.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=814749&r1=814748&r2=814749&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Mon Sep 14 17:33:57 2009
@@ -588,3 +588,5 @@
     MAPREDUCE-826. harchive doesn't use ToolRunner / harchive returns 0 even
     if the job fails with exception (koji Noguchi via mahadev)
 
+    MAPREDUCE-839. unit test TestMiniMRChildTask fails on mac os-x (hong tang
+    via mahadev)

Modified: hadoop/mapreduce/trunk/build.xml
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/build.xml?rev=814749&r1=814748&r2=814749&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/build.xml (original)
+++ hadoop/mapreduce/trunk/build.xml Mon Sep 14 17:33:57 2009
@@ -88,6 +88,7 @@
   <property name="install.c++.examples" 
             value="${build.dir}/c++-examples/${build.platform}"/>
 
+  <property environment="env"/>
   <property name="test.src.dir" value="${basedir}/src/test"/>
   <property name="test.lib.dir" value="${basedir}/src/test/lib"/>
   <property name="test.build.dir" value="${build.dir}/test"/>
@@ -111,6 +112,8 @@
   <property name="test.junit.printsummary" value="yes" />
   <property name="test.junit.haltonfailure" value="no" />
   <property name="test.junit.maxmemory" value="512m" />
+  <property name="test.tmp.dir" value="${env.TMP}" />
+  <property name="test.temp.dir" value="${env.TEMP}" />
 
   <property name="test.tools.input.dir" value="${basedir}/src/test/tools/data" />
 
@@ -578,6 +581,9 @@
         <sysproperty key="java.library.path"
           value="${build.native}/lib:${lib.dir}/native/${build.platform}"/>
         <sysproperty key="install.c++.examples" value="${install.c++.examples}"/>
+        <syspropertyset dynamic="no">
+          <propertyref name="hadoop.tmp.dir"/>
+        </syspropertyset>
         <!-- set compile.c++ in the child jvm only if it is set -->
         <syspropertyset dynamic="no">
           <propertyref name="compile.c++"/>

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRChildTask.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRChildTask.java?rev=814749&r1=814748&r2=814749&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRChildTask.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestMiniMRChildTask.java
Mon Sep 14 17:33:57 2009
@@ -145,13 +145,44 @@
     JobClient.runJob(conf);
     outFs.delete(outDir, true);
 
+    final String DEFAULT_ABS_TMP_PATH = "/tmp";
+    final String DEFAULT_REL_TMP_PATH = "../temp";
+
+    String absoluteTempPath = null;
+    String relativeTempPath = null;
+
+    for (String key : new String[] { "test.temp.dir", "test.tmp.dir" }) {
+      String p = conf.get(key);
+      if (p == null || p.isEmpty()) {
+        continue;
+      }
+      if (new Path(p).isAbsolute()) {
+        if (absoluteTempPath == null) {
+          absoluteTempPath = p;
+        }
+      } else {
+        if (relativeTempPath == null) {
+          relativeTempPath = p;
+        }
+      }
+    }
+
+    if (absoluteTempPath == null) {
+      absoluteTempPath = DEFAULT_ABS_TMP_PATH;
+    }
+    if (relativeTempPath == null) {
+      relativeTempPath = DEFAULT_REL_TMP_PATH;
+    }
+
     // Launch job by giving relative path to temp dir.
-    conf.set("mapred.child.tmp", "../temp");
+    LOG.info("Testing with relative temp dir = "+relativeTempPath);
+    conf.set("mapred.child.tmp", relativeTempPath);
     JobClient.runJob(conf);
     outFs.delete(outDir, true);
 
     // Launch job by giving absolute path to temp dir
-    conf.set("mapred.child.tmp", "/tmp");
+    LOG.info("Testing with absolute temp dir = "+absoluteTempPath);
+    conf.set("mapred.child.tmp", absoluteTempPath);
     JobClient.runJob(conf);
     outFs.delete(outDir, true);
   }



Mime
View raw message