MAPREDUCE-5632. TestRMContainerAllocator#testUpdatedNodes fails (jeagles)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1547932 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Turner Eagles 2013-12-04 22:18:21 +00:00
parent fb03925549
commit 644750fc7d
2 changed files with 14 additions and 2 deletions

View File

@ -92,6 +92,8 @@ Release 2.4.0 - UNRELEASED
MAPREDUCE-5645. TestFixedLengthInputFormat fails with native libs (Mit MAPREDUCE-5645. TestFixedLengthInputFormat fails with native libs (Mit
Desai via jeagles) Desai via jeagles)
MAPREDUCE-5632. TestRMContainerAllocator#testUpdatedNodes fails (jeagles)
Release 2.3.0 - UNRELEASED Release 2.3.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -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.Clock;
import org.apache.hadoop.yarn.util.SystemClock; import org.apache.hadoop.yarn.util.SystemClock;
import org.junit.After; import org.junit.After;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -111,6 +112,12 @@ public class TestRMContainerAllocator {
static final RecordFactory recordFactory = RecordFactoryProvider static final RecordFactory recordFactory = RecordFactoryProvider
.getRecordFactory(null); .getRecordFactory(null);
@Before
public void setup() {
MyContainerAllocator.getJobUpdatedNodeEvents().clear();
MyContainerAllocator.getTaskAttemptKillEvents().clear();
}
@After @After
public void tearDown() { public void tearDown() {
DefaultMetricsSystem.shutdown(); DefaultMetricsSystem.shutdown();
@ -770,6 +777,9 @@ public class TestRMContainerAllocator {
nm1.nodeHeartbeat(true); nm1.nodeHeartbeat(true);
dispatcher.await(); dispatcher.await();
Assert.assertEquals(1, allocator.getJobUpdatedNodeEvents().size());
Assert.assertEquals(3, allocator.getJobUpdatedNodeEvents().get(0).getUpdatedNodes().size());
allocator.getJobUpdatedNodeEvents().clear();
// get the assignment // get the assignment
assigned = allocator.schedule(); assigned = allocator.schedule();
dispatcher.await(); dispatcher.await();
@ -1501,11 +1511,11 @@ public class TestRMContainerAllocator {
return result; return result;
} }
List<TaskAttemptKillEvent> getTaskAttemptKillEvents() { static List<TaskAttemptKillEvent> getTaskAttemptKillEvents() {
return taskAttemptKillEvents; return taskAttemptKillEvents;
} }
List<JobUpdatedNodesEvent> getJobUpdatedNodeEvents() { static List<JobUpdatedNodesEvent> getJobUpdatedNodeEvents() {
return jobUpdatedNodeEvents; return jobUpdatedNodeEvents;
} }