diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 360e9841b8..3645fb6ba5 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -177,6 +177,8 @@ Release 2.1.2 - UNRELEASED YARN-1273. Fixed Distributed-shell to account for containers that failed to start. (Hitesh Shah via vinodkv) + YARN-1268. TestFairScheduler.testContinuousScheduling is flaky (Sandy Ryza) + Release 2.1.1-beta - 2013-09-23 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/fair/TestFairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java index f09d2c4a04..28b95e4196 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java @@ -2279,7 +2279,7 @@ public void testConcurrentAccessOnApplications() throws Exception { fs.applications, FSSchedulerApp.class); } - @Test + @Test (timeout = 5000) public void testContinuousScheduling() throws Exception { // set continuous scheduling enabled FairScheduler fs = new FairScheduler(); @@ -2315,11 +2315,13 @@ public void testContinuousScheduling() throws Exception { // at least one pass Thread.sleep(fs.getConf().getContinuousSchedulingSleepMs() + 500); + FSSchedulerApp app = fs.applications.get(appAttemptId); + // Wait until app gets resources. + while (app.getCurrentConsumption().equals(Resources.none())) { } + // check consumption - Resource consumption = - fs.applications.get(appAttemptId).getCurrentConsumption(); - Assert.assertEquals(1024, consumption.getMemory()); - Assert.assertEquals(1, consumption.getVirtualCores()); + Assert.assertEquals(1024, app.getCurrentConsumption().getMemory()); + Assert.assertEquals(1, app.getCurrentConsumption().getVirtualCores()); }