Browse Source

MAPREDUCE-4909. TestKeyValueTextInputFormat fails with Open JDK 7 on Windows. Contributed by Arpit Agarwal.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1428620 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 12 years ago
parent
commit
cd150bffbc

+ 3 - 0
CHANGES.txt

@@ -382,6 +382,9 @@ Release 1.2.0 - unreleased
     MAPREDUCE-2217. The expire launching task should cover the UNASSIGNED task. 
     (schen and kkambatl via tucu)
 
+    MAPREDUCE-4909. TestKeyValueTextInputFormat fails with Open JDK 7 on
+    Windows. (Arpit Agarwal via suresh)
+
 Release 1.1.2 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 7 - 3
src/test/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java

@@ -47,10 +47,14 @@ public class TestKeyValueTextInputFormat extends TestCase {
   private static Path workDir = 
     new Path(new Path(System.getProperty("test.build.data", "."), "data"),
              "TestKeyValueTextInputFormat");
+
+  private static Path workDirFormat =
+      new Path(new Path(System.getProperty("test.build.data", "."), "data"),
+          "TestKeyValueTextInputFormat-testFormat");
   
   public void testFormat() throws Exception {
     JobConf job = new JobConf();
-    Path file = new Path(workDir, "test.txt");
+    Path file = new Path(workDirFormat, "test.txt");
 
     // A reporter that does nothing
     Reporter reporter = Reporter.NULL;
@@ -59,8 +63,8 @@ public class TestKeyValueTextInputFormat extends TestCase {
     LOG.info("seed = "+seed);
     Random random = new Random(seed);
 
-    localFs.delete(workDir, true);
-    FileInputFormat.setInputPaths(job, workDir);
+    localFs.delete(workDirFormat, true);
+    FileInputFormat.setInputPaths(job, workDirFormat);
 
     // for a variety of lengths
     for (int length = 0; length < MAX_LENGTH;

+ 7 - 3
src/test/org/apache/hadoop/mapreduce/lib/input/TestKeyValueTextInputFormat.java

@@ -55,17 +55,21 @@ public class TestKeyValueTextInputFormat extends TestCase {
   private static Path workDir = 
     new Path(new Path(System.getProperty("test.build.data", "."), "data"),
              "TestKeyValueTextInputFormat");
+
+  private static Path workDirFormat =
+      new Path(new Path(System.getProperty("test.build.data", "."), "data"),
+          "TestKeyValueTextInputFormat-testFormat");
   
   public void testFormat() throws Exception {
     Job job = new Job(defaultConf);
-    Path file = new Path(workDir, "test.txt");
+    Path file = new Path(workDirFormat, "test.txt");
 
     int seed = new Random().nextInt();
     LOG.info("seed = "+seed);
     Random random = new Random(seed);
 
-    localFs.delete(workDir, true);
-    FileInputFormat.setInputPaths(job, workDir);
+    localFs.delete(workDirFormat, true);
+    FileInputFormat.setInputPaths(job, workDirFormat);
 
     // for a variety of lengths
     for (int length = 0; length < MAX_LENGTH;