svn merge -c 1543117 FIXES: YARN-1419. TestFifoScheduler.testAppAttemptMetrics fails intermittently under jdk7. Contributed by Jonathan Eagles

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1543121 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2013-11-18 19:29:29 +00:00
parent c155a5b368
commit 40129be1fe
2 changed files with 7 additions and 2 deletions

View File

@ -121,6 +121,9 @@ Release 2.3.0 - UNRELEASED
YARN-1411. HA config shouldn't affect NodeManager RPC addresses (Karthik YARN-1411. HA config shouldn't affect NodeManager RPC addresses (Karthik
Kambatla via bikas) Kambatla via bikas)
YARN-1419. TestFifoScheduler.testAppAttemptMetrics fails intermittently
under jdk7 (Jonathan Eagles via jlowe)
Release 2.2.1 - UNRELEASED Release 2.2.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -141,6 +141,8 @@ public class TestFifoScheduler {
FifoScheduler schedular = new FifoScheduler(); FifoScheduler schedular = new FifoScheduler();
schedular.reinitialize(new Configuration(), rmContext); schedular.reinitialize(new Configuration(), rmContext);
QueueMetrics metrics = schedular.getRootQueueMetrics();
int beforeAppsSubmitted = metrics.getAppsSubmitted();
ApplicationId appId = BuilderUtils.newApplicationId(200, 1); ApplicationId appId = BuilderUtils.newApplicationId(200, 1);
ApplicationAttemptId appAttemptId = BuilderUtils.newApplicationAttemptId( ApplicationAttemptId appAttemptId = BuilderUtils.newApplicationAttemptId(
@ -155,8 +157,8 @@ public class TestFifoScheduler {
event = new AppAddedSchedulerEvent(appAttemptId, "queue", "user"); event = new AppAddedSchedulerEvent(appAttemptId, "queue", "user");
schedular.handle(event); schedular.handle(event);
QueueMetrics metrics = schedular.getRootQueueMetrics(); int afterAppsSubmitted = metrics.getAppsSubmitted();
Assert.assertEquals(1, metrics.getAppsSubmitted()); Assert.assertEquals(1, afterAppsSubmitted - beforeAppsSubmitted);
} }
@Test(timeout=2000) @Test(timeout=2000)