YARN-5349. TestWorkPreservingRMRestart#testUAMRecoveryOnRMWorkPreservingRestart fail intermittently. Contributed by Jason Lowe.

(cherry picked from commit 8ce8672b6b551dacb9467924fc70f88790f5891f)
This commit is contained in:
Eric Payne 2017-08-02 12:53:22 -05:00
parent d5150e3148
commit 8943cf9d30

View File

@ -1329,11 +1329,11 @@ public void testContainerCompleteMsgNotLostAfterAMFailedAndRMRestart() throws Ex
nm1.nodeHeartbeat(true);
List<Container> conts = am0.allocate(new ArrayList<ResourceRequest>(),
new ArrayList<ContainerId>()).getAllocatedContainers();
while (conts.size() == 0) {
while (conts.size() < 2) {
nm1.nodeHeartbeat(true);
conts.addAll(am0.allocate(new ArrayList<ResourceRequest>(),
new ArrayList<ContainerId>()).getAllocatedContainers());
Thread.sleep(500);
Thread.sleep(100);
}
// am failed,and relaunch it
@ -1433,14 +1433,12 @@ public void testUAMRecoveryOnRMWorkPreservingRestart() throws Exception {
nm1.nodeHeartbeat(true);
List<Container> conts = am0.allocate(new ArrayList<ResourceRequest>(),
new ArrayList<ContainerId>()).getAllocatedContainers();
Assert.assertTrue(conts.isEmpty());
while (conts.size() == 0) {
while (conts.size() < 2) {
nm1.nodeHeartbeat(true);
conts.addAll(am0.allocate(new ArrayList<ResourceRequest>(),
new ArrayList<ContainerId>()).getAllocatedContainers());
Thread.sleep(500);
Thread.sleep(100);
}
Assert.assertFalse(conts.isEmpty());
// start new RM
rm2 = new MockRM(conf, memStore);