YARN-9404. TestApplicationLifetimeMonitor#testApplicationLifetimeMonitor fails intermittent. Contributed by Prabhu Joseph.

This commit is contained in:
Giovanni Matteo Fumarola 2019-03-22 11:45:39 -07:00
parent 1d389ecb24
commit 509b20b292

View File

@ -204,13 +204,12 @@ public void testApplicationLifetimeMonitor()
// app4 submitted exceeding queue max lifetime, // app4 submitted exceeding queue max lifetime,
// so killed after queue max lifetime. // so killed after queue max lifetime.
rm.waitForState(app4.getApplicationId(), RMAppState.KILLED); rm.waitForState(app4.getApplicationId(), RMAppState.KILLED);
long totalTimeRun = long totalTimeRun = app4.getFinishTime() - app4.getSubmitTime();
(app4.getFinishTime() - app4.getSubmitTime()) / 1000;
Assert.assertTrue("Application killed before lifetime value", Assert.assertTrue("Application killed before lifetime value",
totalTimeRun > maxLifetime); totalTimeRun > (maxLifetime * 1000));
Assert.assertTrue( Assert.assertTrue(
"Application killed before lifetime value " + totalTimeRun, "Application killed before lifetime value " + totalTimeRun,
totalTimeRun < maxLifetime + 10L); totalTimeRun < ((maxLifetime + 10L) * 1000));
} }
} finally { } finally {
stopRM(rm); stopRM(rm);