From 9ba98e6af1380551c85282e02cbe83e3329228e5 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Eagles Date: Wed, 4 Dec 2013 22:11:28 +0000 Subject: [PATCH] MAPREDUCE-5632. TestRMContainerAllocator#testUpdatedNodes fails (jeagles) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1547929 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 2 ++ .../mapreduce/v2/app/TestRMContainerAllocator.java | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index a9527bc4bac..fba63583089 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -229,6 +229,8 @@ Release 2.4.0 - UNRELEASED MAPREDUCE-5645. TestFixedLengthInputFormat fails with native libs (Mit Desai via jeagles) + MAPREDUCE-5632. TestRMContainerAllocator#testUpdatedNodes fails (jeagles) + Release 2.3.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java index ee0544a0537..9a962364e92 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java @@ -101,6 +101,7 @@ import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoSchedule import org.apache.hadoop.yarn.util.Clock; import org.apache.hadoop.yarn.util.SystemClock; import org.junit.After; +import org.junit.Before; import org.junit.Test; @SuppressWarnings("unchecked") @@ -111,6 +112,12 @@ public class TestRMContainerAllocator { static final RecordFactory recordFactory = RecordFactoryProvider .getRecordFactory(null); + @Before + public void setup() { + MyContainerAllocator.getJobUpdatedNodeEvents().clear(); + MyContainerAllocator.getTaskAttemptKillEvents().clear(); + } + @After public void tearDown() { DefaultMetricsSystem.shutdown(); @@ -770,6 +777,9 @@ public class TestRMContainerAllocator { nm1.nodeHeartbeat(true); dispatcher.await(); + Assert.assertEquals(1, allocator.getJobUpdatedNodeEvents().size()); + Assert.assertEquals(3, allocator.getJobUpdatedNodeEvents().get(0).getUpdatedNodes().size()); + allocator.getJobUpdatedNodeEvents().clear(); // get the assignment assigned = allocator.schedule(); dispatcher.await(); @@ -1501,11 +1511,11 @@ public class TestRMContainerAllocator { return result; } - List getTaskAttemptKillEvents() { + static List getTaskAttemptKillEvents() { return taskAttemptKillEvents; } - List getJobUpdatedNodeEvents() { + static List getJobUpdatedNodeEvents() { return jobUpdatedNodeEvents; }