diff --git hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java index 47b38a1..207d0f6 100644 --- hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java +++ hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java @@ -190,6 +190,7 @@ public void serviceInit(Configuration conf) throws Exception { public JobHistoryServerWrapper() { super(JobHistoryServerWrapper.class.getName()); } + private volatile boolean jhsStarted = false; @Override public synchronized void serviceStart() throws Exception { @@ -211,9 +212,11 @@ public synchronized void serviceStart() throws Exception { new Thread() { public void run() { historyServer.start(); + jhsStarted = true; }; }.start(); - while (historyServer.getServiceState() == STATE.INITED) { + + while (!jhsStarted) { LOG.info("Waiting for HistoryServer to start..."); Thread.sleep(1500); }