diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 0e506a4954c..cc4e49a6675 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -49,6 +49,9 @@ Release 2.1.1-beta - UNRELEASED MAPREDUCE-5352. Optimize node local splits generated by CombineFileInputFormat. (sseth) + MAPREDUCE-5446. TestJobHistoryEvents and TestJobHistoryParsing have race + conditions (jlowe via kihwal) + BUG FIXES MAPREDUCE-5385. Fixed a bug with JobContext getCacheFiles API. (Omkar Vinit diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/MRApp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/MRApp.java index 7073ba4844e..6d1804f0627 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/MRApp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/MRApp.java @@ -357,15 +357,20 @@ public class MRApp extends MRAppMaster { } public void waitForState(Service.STATE finalState) throws Exception { - int timeoutSecs = 0; - while (!finalState.equals(getServiceState()) && timeoutSecs++ < 20) { - System.out.println("MRApp State is : " + getServiceState() - + " Waiting for state : " + finalState); - Thread.sleep(500); + if (finalState == Service.STATE.STOPPED) { + Assert.assertTrue("Timeout while waiting for MRApp to stop", + waitForServiceToStop(20 * 1000)); + } else { + int timeoutSecs = 0; + while (!finalState.equals(getServiceState()) && timeoutSecs++ < 20) { + System.out.println("MRApp State is : " + getServiceState() + + " Waiting for state : " + finalState); + Thread.sleep(500); + } + System.out.println("MRApp State is : " + getServiceState()); + Assert.assertEquals("MRApp state is not correct (timedout)", finalState, + getServiceState()); } - System.out.println("MRApp State is : " + getServiceState()); - Assert.assertEquals("MRApp state is not correct (timedout)", finalState, - getServiceState()); } public void verifyCompleted() {