Browse Source

HADOOP-4632. Fix TestJobHistoryVersion to use test.build.dir instead of the
current workding directory for scratch space. Contributed by Amar Kamat.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@723219 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas 16 years ago
parent
commit
0555079861
2 changed files with 21 additions and 4 deletions
  1. 6 3
      CHANGES.txt
  2. 15 1
      src/test/org/apache/hadoop/mapred/TestJobHistoryVersion.java

+ 6 - 3
CHANGES.txt

@@ -253,9 +253,6 @@ main source files. (pete wyckoff via mahadev)
     HADOOP-4732. Pass connection and read timeouts in the correct order when
     setting up fetch in reduce. (Amareshwari Sriramadasu via cdouglas)
 
-    HADOOP-4420. Add null checks for job, caused by invalid job IDs.
-    (Aaron Kimball via tomwhite)
-
 Release 0.19.1 - Unreleased
 
   IMPROVEMENTS
@@ -268,6 +265,12 @@ Release 0.19.1 - Unreleased
     HADOOP-4697. Fix getBlockLocations in KosmosFileSystem to handle multiple
     blocks correctly. (Sriram Rao via cdouglas)
 
+    HADOOP-4420. Add null checks for job, caused by invalid job IDs.
+    (Aaron Kimball via tomwhite)
+
+    HADOOP-4632. Fix TestJobHistoryVersion to use test.build.dir instead of the
+    current workding directory for scratch space. (Amar Kamat via cdouglas)
+
 Release 0.19.0 - 2008-11-18
 
   INCOMPATIBLE CHANGES

+ 15 - 1
src/test/org/apache/hadoop/mapred/TestJobHistoryVersion.java

@@ -43,7 +43,9 @@ public class TestJobHistoryVersion extends TestCase {
     + "Map-Reduce Framework.Map input records:0,"
     + "Map-Reduce Framework.Map input bytes:0,"
     + "File Systems.HDFS bytes written:0,";
-  private static final String TEST_DIR = "test-history-version";
+  private static final Path TEST_DIR = 
+    new Path(System.getProperty("test.build.data", "/tmp"), 
+             "test-history-version");
   private static final String DELIM = ".";
   
   
@@ -115,6 +117,9 @@ public class TestJobHistoryVersion extends TestCase {
     JobConf conf = new JobConf();
     FileSystem fs = FileSystem.getLocal(conf);
     
+    // cleanup
+    fs.delete(TEST_DIR, true);
+    
     Path historyPath = new Path(TEST_DIR + "/_logs/history/" + FILENAME);
     
     fs.delete(historyPath, false);
@@ -128,6 +133,9 @@ public class TestJobHistoryVersion extends TestCase {
     
     assertTrue("Failed to parse old jobhistory files", 
                job.getAllTasks().size() > 0);
+    
+    // cleanup
+    fs.delete(TEST_DIR, true);
   }
   
   /**
@@ -137,6 +145,9 @@ public class TestJobHistoryVersion extends TestCase {
     JobConf conf = new JobConf();
     FileSystem fs = FileSystem.getLocal(conf);
     
+    // cleanup
+    fs.delete(TEST_DIR, true);
+    
     Path historyPath = new Path(TEST_DIR + "/_logs/history/" + FILENAME);
     
     fs.delete(historyPath, false);
@@ -150,5 +161,8 @@ public class TestJobHistoryVersion extends TestCase {
     
     assertTrue("Failed to parse old jobhistory files", 
                job.getAllTasks().size() > 0);
+    
+    // cleanup
+    fs.delete(TEST_DIR, true);
   }
 }