YARN-4320. TestJobHistoryEventHandler fails as AHS in MiniYarnCluster no longer binds to default port 8188. Contributed by Varun Saxena.

(cherry picked from commit ce31b22739)
This commit is contained in:
Tsuyoshi Ozawa 2015-10-30 17:51:39 +09:00 committed by Sangjin Lee
parent 0b55634b9c
commit 6b27de0f36
3 changed files with 16 additions and 3 deletions

View File

@ -446,9 +446,6 @@ public class TestJobHistoryEventHandler {
TestParams t = new TestParams(false); TestParams t = new TestParams(false);
Configuration conf = new YarnConfiguration(); Configuration conf = new YarnConfiguration();
conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true); conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_EMIT_TIMELINE_DATA, true);
JHEvenHandlerForTest jheh = new JHEvenHandlerForTest(t.mockAppContext, 0);
jheh.init(conf);
MiniYARNCluster yarnCluster = null; MiniYARNCluster yarnCluster = null;
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
try { try {
@ -456,6 +453,13 @@ public class TestJobHistoryEventHandler {
TestJobHistoryEventHandler.class.getSimpleName(), 1, 1, 1, 1); TestJobHistoryEventHandler.class.getSimpleName(), 1, 1, 1, 1);
yarnCluster.init(conf); yarnCluster.init(conf);
yarnCluster.start(); yarnCluster.start();
Configuration confJHEH = new YarnConfiguration(conf);
confJHEH.setBoolean(MRJobConfig.MAPREDUCE_JOB_EMIT_TIMELINE_DATA, true);
confJHEH.set(YarnConfiguration.TIMELINE_SERVICE_WEBAPP_ADDRESS,
MiniYARNCluster.getHostname() + ":" +
yarnCluster.getApplicationHistoryServer().getPort());
JHEvenHandlerForTest jheh = new JHEvenHandlerForTest(t.mockAppContext, 0);
jheh.init(confJHEH);
jheh.start(); jheh.start();
TimelineStore ts = yarnCluster.getApplicationHistoryServer() TimelineStore ts = yarnCluster.getApplicationHistoryServer()
.getTimelineStore(); .getTimelineStore();

View File

@ -18,6 +18,9 @@ Release 2.6.3 - UNRELEASED
YARN-4312. TestSubmitApplicationWithRMHA fails on branch-2.7 and branch-2.6 YARN-4312. TestSubmitApplicationWithRMHA fails on branch-2.7 and branch-2.6
as some of the test cases time out. (Varun Saxena via ozawa) as some of the test cases time out. (Varun Saxena via ozawa)
YARN-4320. TestJobHistoryEventHandler fails as AHS in MiniYarnCluster no longer
binds to default port 8188. (Varun Saxena via ozawa)
Release 2.6.2 - 2015-10-28 Release 2.6.2 - 2015-10-28
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -127,6 +127,12 @@ public class ApplicationHistoryServer extends CompositeService {
return this.ahsClientService; return this.ahsClientService;
} }
@Private
@VisibleForTesting
public int getPort() {
return this.webApp.httpServer().getConnectorAddress(0).getPort();
}
/** /**
* @return ApplicationTimelineStore * @return ApplicationTimelineStore
*/ */