MAPREDUCE-6029. TestCommitterEventHandler fails in trunk. Contributed by Mit Desai

(cherry picked from commit 2e789eb226)
This commit is contained in:
Jason Lowe 2014-10-07 14:10:39 +00:00
parent 70c8cb5614
commit 979b915ecc
2 changed files with 10 additions and 2 deletions

View File

@ -192,6 +192,9 @@ Release 2.6.0 - UNRELEASED
MAPREDUCE-6094. TestMRCJCFileInputFormat.testAddInputPath() fails on trunk MAPREDUCE-6094. TestMRCJCFileInputFormat.testAddInputPath() fails on trunk
(Akira AJISAKA via jlowe) (Akira AJISAKA via jlowe)
MAPREDUCE-6029. TestCommitterEventHandler fails in trunk (Mit Desai via
jlowe)
Release 2.5.1 - 2014-09-05 Release 2.5.1 - 2014-09-05
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -58,6 +58,7 @@ import org.apache.hadoop.mapreduce.v2.app.job.event.JobCommitCompletedEvent;
import org.apache.hadoop.mapreduce.v2.app.job.event.JobCommitFailedEvent; import org.apache.hadoop.mapreduce.v2.app.job.event.JobCommitFailedEvent;
import org.apache.hadoop.mapreduce.v2.util.MRApps; import org.apache.hadoop.mapreduce.v2.util.MRApps;
import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.Time;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.event.Event; import org.apache.hadoop.yarn.event.Event;
@ -84,8 +85,12 @@ public class TestCommitterEventHandler {
public synchronized Event getAndClearEvent() throws InterruptedException { public synchronized Event getAndClearEvent() throws InterruptedException {
if (event == null) { if (event == null) {
//Wait for at most 10 ms final long waitTime = 5000;
wait(100); long waitStartTime = Time.monotonicNow();
while(event == null && Time.monotonicNow() - waitStartTime < waitTime) {
//Wait for at most 5 sec
wait(waitTime);
}
} }
Event e = event; Event e = event;
event = null; event = null;