YARN-4573. Fix test failure in TestRMAppTransitions#testAppRunningKill and testAppKilledKilled. (Takashi Ohnishi via rohithsharmaks)

(cherry picked from commit c01bee0108)

Conflicts:

	hadoop-yarn-project/CHANGES.txt
This commit is contained in:
Jason Lowe 2016-08-05 20:10:04 +00:00
parent 5b3deac2e3
commit 470ea3da1f
1 changed files with 5 additions and 4 deletions

View File

@ -275,7 +275,7 @@ protected RMApp createNewTestApp(ApplicationSubmissionContext submissionContext)
// Test expected newly created app state // Test expected newly created app state
private static void testAppStartState(ApplicationId applicationId, private static void testAppStartState(ApplicationId applicationId,
String user, String name, String queue, RMApp application) { String user, String name, String queue, RMApp application) {
Assert.assertTrue("application start time is not greater then 0", Assert.assertTrue("application start time is not greater than 0",
application.getStartTime() > 0); application.getStartTime() > 0);
Assert.assertTrue("application start time is before currentTime", Assert.assertTrue("application start time is before currentTime",
application.getStartTime() <= System.currentTimeMillis()); application.getStartTime() <= System.currentTimeMillis());
@ -300,7 +300,7 @@ private static void testAppStartState(ApplicationId applicationId,
// test to make sure times are set when app finishes // test to make sure times are set when app finishes
private static void assertStartTimeSet(RMApp application) { private static void assertStartTimeSet(RMApp application) {
Assert.assertTrue("application start time is not greater then 0", Assert.assertTrue("application start time is not greater than 0",
application.getStartTime() > 0); application.getStartTime() > 0);
Assert.assertTrue("application start time is before currentTime", Assert.assertTrue("application start time is before currentTime",
application.getStartTime() <= System.currentTimeMillis()); application.getStartTime() <= System.currentTimeMillis());
@ -319,9 +319,9 @@ private static void assertFinalAppStatus(FinalApplicationStatus status, RMApp ap
// test to make sure times are set when app finishes // test to make sure times are set when app finishes
private void assertTimesAtFinish(RMApp application) { private void assertTimesAtFinish(RMApp application) {
assertStartTimeSet(application); assertStartTimeSet(application);
Assert.assertTrue("application finish time is not greater then 0", Assert.assertTrue("application finish time is not greater than 0",
(application.getFinishTime() > 0)); (application.getFinishTime() > 0));
Assert.assertTrue("application finish time is not >= then start time", Assert.assertTrue("application finish time is not >= than start time",
(application.getFinishTime() >= application.getStartTime())); (application.getFinishTime() >= application.getStartTime()));
} }
@ -364,6 +364,7 @@ private void sendAttemptUpdateSavedEvent(RMApp application) {
application.getCurrentAppAttempt().handle( application.getCurrentAppAttempt().handle(
new RMAppAttemptEvent(application.getCurrentAppAttempt().getAppAttemptId(), new RMAppAttemptEvent(application.getCurrentAppAttempt().getAppAttemptId(),
RMAppAttemptEventType.ATTEMPT_UPDATE_SAVED)); RMAppAttemptEventType.ATTEMPT_UPDATE_SAVED));
rmDispatcher.await();
} }
protected RMApp testCreateAppNewSaving( protected RMApp testCreateAppNewSaving(