From 40129be1fea7a6f02cdc14086b2504199c836a9f Mon Sep 17 00:00:00 2001 From: Jason Darrell Lowe Date: Mon, 18 Nov 2013 19:29:29 +0000 Subject: [PATCH] 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 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../resourcemanager/scheduler/fifo/TestFifoScheduler.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 58e0d5b2a62..cd1a8427f1f 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -121,6 +121,9 @@ Release 2.3.0 - UNRELEASED YARN-1411. HA config shouldn't affect NodeManager RPC addresses (Karthik Kambatla via bikas) + YARN-1419. TestFifoScheduler.testAppAttemptMetrics fails intermittently + under jdk7 (Jonathan Eagles via jlowe) + Release 2.2.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java index 238459097e7..00cb71ebe49 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java @@ -141,6 +141,8 @@ public class TestFifoScheduler { FifoScheduler schedular = new FifoScheduler(); schedular.reinitialize(new Configuration(), rmContext); + QueueMetrics metrics = schedular.getRootQueueMetrics(); + int beforeAppsSubmitted = metrics.getAppsSubmitted(); ApplicationId appId = BuilderUtils.newApplicationId(200, 1); ApplicationAttemptId appAttemptId = BuilderUtils.newApplicationAttemptId( @@ -155,8 +157,8 @@ public class TestFifoScheduler { event = new AppAddedSchedulerEvent(appAttemptId, "queue", "user"); schedular.handle(event); - QueueMetrics metrics = schedular.getRootQueueMetrics(); - Assert.assertEquals(1, metrics.getAppsSubmitted()); + int afterAppsSubmitted = metrics.getAppsSubmitted(); + Assert.assertEquals(1, afterAppsSubmitted - beforeAppsSubmitted); } @Test(timeout=2000)