YARN-9315. TestCapacitySchedulerMetrics fails intermittently. Contributed by Prabhu Joseph.

This commit is contained in:
Weiwei Yang 2019-02-21 17:21:21 +08:00
parent 704330a616
commit 1ffa7f8349
1 changed files with 6 additions and 6 deletions

View File

@ -87,18 +87,18 @@ public class TestCapacitySchedulerMetrics {
nm1.nodeHeartbeat(true); nm1.nodeHeartbeat(true);
nm2.nodeHeartbeat(true); nm2.nodeHeartbeat(true);
// Verify HB metrics updated
try { try {
// Verify HB metrics updated
GenericTestUtils.waitFor(() GenericTestUtils.waitFor(()
-> csMetrics.getNumOfNodeUpdate() == 4, 100, 3000); -> csMetrics.getNumOfNodeUpdate() == 4, 100, 3000);
} catch(TimeoutException e) {
Assert.fail("CS metrics not updated on node-update events.");
}
// For async mode, the number of alloc might be bigger than 1 // For async mode, the number of alloc might be bigger than 1
Assert.assertTrue(csMetrics.getNumOfAllocates() > 0); Assert.assertTrue(csMetrics.getNumOfAllocates() > 0);
// But there will be only 2 successful commit (1 AM + 1 task) // But there will be only 2 successful commit (1 AM + 1 task)
Assert.assertEquals(2, csMetrics.getNumOfCommitSuccess()); GenericTestUtils.waitFor(()
-> csMetrics.getNumOfCommitSuccess() == 2, 100, 3000);
} catch(TimeoutException e) {
Assert.fail("CS metrics not updated on node-update events.");
}
} }
@After @After