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
parent 6636441911
commit c84ec0657f
3 changed files with 11 additions and 4 deletions

View File

@ -489,9 +489,6 @@ public class TestJobHistoryEventHandler {
TestParams t = new TestParams(false);
Configuration conf = new YarnConfiguration();
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;
long currentTime = System.currentTimeMillis();
try {
@ -499,6 +496,13 @@ public class TestJobHistoryEventHandler {
TestJobHistoryEventHandler.class.getSimpleName(), 1, 1, 1, 1);
yarnCluster.init(conf);
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();
TimelineStore ts = yarnCluster.getApplicationHistoryServer()
.getTimelineStore();

View File

@ -109,6 +109,9 @@ Release 2.7.2 - UNRELEASED
YARN-4312. TestSubmitApplicationWithRMHA fails on branch-2.7 and branch-2.6
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.7.1 - 2015-07-06
INCOMPATIBLE CHANGES

View File

@ -133,7 +133,7 @@ public class ApplicationHistoryServer extends CompositeService {
@Private
@VisibleForTesting
int getPort() {
public int getPort() {
return this.webApp.httpServer().getConnectorAddress(0).getPort();
}