hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1377895 - in /hadoop/common/branches/branch-1: CHANGES.txt src/test/org/apache/hadoop/mapred/TestLostTracker.java
Date Mon, 27 Aug 2012 22:38:13 GMT
Author: tucu
Date: Mon Aug 27 22:38:13 2012
New Revision: 1377895

URL: http://svn.apache.org/viewvc?rev=1377895&view=rev
Log:
MAPREDUCE-4595. TestLostTracker failing - possibly due to a race in JobHistory.JobHistoryFilesManager#run()
(kkambatl via tucu)

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

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1377895&r1=1377894&r2=1377895&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Mon Aug 27 22:38:13 2012
@@ -210,6 +210,9 @@ Release 1.2.0 - unreleased
     HADOOP-4572. Can not access user logs - Jetty is not configured by default 
     to serve aliases/symlinks (ahmed via tucu)
 
+    MAPREDUCE-4595. TestLostTracker failing - possibly due to a race in 
+    JobHistory.JobHistoryFilesManager#run() (kkambatl via tucu)
+
 Release 1.1.0 - unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestLostTracker.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestLostTracker.java?rev=1377895&r1=1377894&r2=1377895&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestLostTracker.java
(original)
+++ hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestLostTracker.java
Mon Aug 27 22:38:13 2012
@@ -101,6 +101,25 @@ public class TestLostTracker extends Tes
       testTaskStatuses(mtip.getTaskStatuses());
     }
     
+    // Before validating job history, wait for the history file to be available
+    JobInProgress jip = mr.getJobTrackerRunner().getJobTracker().getJob(id);
+    long beginWaiting = System.currentTimeMillis();
+    final long MAX_WAIT_TIME = 5 * 60 * 1000;
+    while (System.currentTimeMillis() - beginWaiting < MAX_WAIT_TIME) {
+      if (!jip.getHistoryFile().equals("")) {
+        break;
+      } else {
+        try {
+          Thread.sleep(50);
+        } catch (InterruptedException ie) {
+          // do nothing
+        }
+      }
+    }
+
+    assertFalse("Job history file needs to be set for further validation", jip
+        .getHistoryFile().equals(""));
+
     // validate the history file
     TestJobHistory.validateJobHistoryFileFormat(id, job, "SUCCESS", true);
     TestJobHistory.validateJobHistoryFileContent(mr, rJob, job);



Mime
View raw message