YARN-5491. Fix random failure of TestCapacityScheduler#testCSQueueBlocked (Bibin A Chundatt via Varun Saxena)

(cherry picked from commit d677b68c25)
This commit is contained in:
Varun Saxena 2016-08-15 03:31:21 +05:30 committed by Jason Lowe
parent d03240e0bf
commit 3656b84085
1 changed files with 6 additions and 2 deletions

View File

@ -3606,7 +3606,7 @@ public class TestCapacityScheduler {
}
assertEquals("A Used Resource should be 2 GB", 2 * GB,
cs.getQueue("a").getUsedResources().getMemorySize());
assertEquals("B Used Resource should be 2 GB", 13 * GB,
assertEquals("B Used Resource should be 13 GB", 13 * GB,
cs.getQueue("b").getUsedResources().getMemorySize());
r1 = TestUtils.createResourceRequest(
ResourceRequest.ANY, 2 * GB, 1, true, priority, recordFactory);
@ -3630,10 +3630,14 @@ public class TestCapacityScheduler {
ContainerId containerId2 =ContainerId.newContainerId(appAttemptId2, 11);
cs.handle(new ContainerExpiredSchedulerEvent(containerId1));
rm.drainEvents();
CapacityScheduler.schedule(cs);
cs.handle(new ContainerExpiredSchedulerEvent(containerId2));
CapacityScheduler.schedule(cs);
rm.drainEvents();
assertEquals("A Used Resource should be 2 GB", 4 * GB,
assertEquals("A Used Resource should be 4 GB", 4 * GB,
cs.getQueue("a").getUsedResources().getMemorySize());
assertEquals("B Used Resource should be 12 GB", 12 * GB,
cs.getQueue("b").getUsedResources().getMemorySize());