You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by tu...@apache.org on 2013/03/15 21:12:30 UTC

svn commit: r1457093 - in /hadoop/common/branches/branch-1: CHANGES.txt src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java

Author: tucu
Date: Fri Mar 15 20:12:29 2013
New Revision: 1457093

URL: http://svn.apache.org/r1457093
Log:
MAPREDUCE-5073. TestJobStatusPersistency.testPersistency fails on JDK7. (sandyr via tucu)

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1457093&r1=1457092&r2=1457093&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Fri Mar 15 20:12:29 2013
@@ -19,6 +19,9 @@ Release 1.3.0 - unreleased
     MAPREDUCE-5072. TestDelegationTokenRenewal.testDTRenewal fails in MR1 
     on jdk7. (sandyr via tucu)
 
+    MAPREDUCE-5073. TestJobStatusPersistency.testPersistency fails on 
+    JDK7. (sandyr via tucu)
+
 Release 1.2.0 - unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java?rev=1457093&r1=1457092&r2=1457093&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java (original)
+++ hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java Fri Mar 15 20:12:29 2013
@@ -38,6 +38,13 @@ public class TestJobStatusPersistency ex
   protected void setUp() throws Exception {
     // Don't start anything by default
   }
+  
+  @Override
+  protected void tearDown() throws Exception {
+    super.tearDown();
+    FileSystem fs = FileSystem.getLocal(new JobConf());
+    fs.delete(TEST_DIR, true);
+  }
 
   private JobID runJob() throws Exception {
     OutputStream os = getFileSystem().create(new Path(getInputDir(), "text.txt"));
@@ -87,7 +94,7 @@ public class TestJobStatusPersistency ex
     Properties config = new Properties();
     config.setProperty("mapred.job.tracker.persist.jobstatus.active", "true");
     config.setProperty("mapred.job.tracker.persist.jobstatus.hours", "1");
-    startCluster(false, config);
+    startCluster(true, config);
     JobID jobId = runJob();
     JobClient jc = new JobClient(createJobConf());
     RunningJob rj0 = jc.getJob(jobId);
@@ -118,11 +125,8 @@ public class TestJobStatusPersistency ex
   /**
    * Test if the completed job status is persisted to localfs.
    */
-  public void testLocalPersistency() throws Exception {
+  public void testLocalPersistency() throws Exception {    
     FileSystem fs = FileSystem.getLocal(new JobConf());
-    
-    fs.delete(TEST_DIR, true);
-    
     Properties config = new Properties();
     config.setProperty("mapred.job.tracker.persist.jobstatus.active", "true");
     config.setProperty("mapred.job.tracker.persist.jobstatus.hours", "1");
@@ -137,7 +141,6 @@ public class TestJobStatusPersistency ex
     // check if the local fs has the data
     Path jobInfo = new Path(TEST_DIR, rj.getID() + ".info");
     assertTrue("Missing job info from the local fs", fs.exists(jobInfo));
-    fs.delete(TEST_DIR, true);
   }
 
   /**
@@ -152,10 +155,6 @@ public class TestJobStatusPersistency ex
     try {
       FileSystem fs = FileSystem.getLocal(new JobConf());
 
-      if (fs.exists(TEST_DIR) && !fs.delete(TEST_DIR, true)) {
-        fail("Cannot delete TEST_DIR!");
-      }
-
       if (fs.mkdirs(new Path(TEST_DIR, parent))) {
         if (!(new File(parent.toUri().getPath()).setWritable(false, false))) {
           fail("Cannot chmod parent!");