[ 
https://issues.apache.org/jira/browse/YARN-1786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13920410#comment-13920410
 ] 

shenhong commented on YARN-1786:
--------------------------------

Here is the code:
{code}
  private void sendAppUpdateSavedEvent(RMApp application) {
    RMAppEvent event =
        new RMAppUpdateSavedEvent(application.getApplicationId(), null);
    application.handle(event);
    rmDispatcher.await();
  }

  private void sendAttemptUpdateSavedEvent(RMApp application) {
    application.getCurrentAppAttempt().handle(
      new RMAppAttemptUpdateSavedEvent(application.getCurrentAppAttempt()
        .getAppAttemptId(), null));
  }
{code}
At sendAttemptUpdateSavedEvent(), there is no rmDispatcher.await() after handle 
an event, it should be changed to 
{code}
  private void sendAttemptUpdateSavedEvent(RMApp application) {
    application.getCurrentAppAttempt().handle(
      new RMAppAttemptUpdateSavedEvent(application.getCurrentAppAttempt()
        .getAppAttemptId(), null));
   rmDispatcher.await();
  }
{code}

> TestRMAppTransitions occasionally fail
> --------------------------------------
>
>                 Key: YARN-1786
>                 URL: https://issues.apache.org/jira/browse/YARN-1786
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: resourcemanager
>    Affects Versions: 2.3.0
>            Reporter: shenhong
>
> TestRMAppTransitions often fail with "application finish time is not greater 
> then 0", following is log:
> {code}
> testAppAcceptedKill[0](org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions)
>  Time elapsed: 0.04 sec <<< FAILURE! junit.framework.AssertionFailedError: 
> application finish time is not greater then 0 at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.assertTimesAtFinish(TestRMAppTransitions.java:283)
>  at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.assertKilled(TestRMAppTransitions.java:298)
>  at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.assertAppAndAttemptKilled(TestRMAppTransitions.java:310)
>  at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.testAppAcceptedKill(TestRMAppTransitions.java:624)
>  
> testAppRunningKill[0](org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions)
>  Time elapsed: 0.033 sec <<< FAILURE! junit.framework.AssertionFailedError: 
> application finish time is not greater then 0 at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.assertTimesAtFinish(TestRMAppTransitions.java:283)
>  at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.assertKilled(TestRMAppTransitions.java:298)
>  at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.testAppRunningKill(TestRMAppTransitions.java:646)
>  
> testAppRunningKill[1](org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions)
>  Time elapsed: 0.036 sec <<< FAILURE! junit.framework.AssertionFailedError: 
> application finish time is not greater then 0 at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.assertTimesAtFinish(TestRMAppTransitions.java:283)
>  at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.assertKilled(TestRMAppTransitions.java:298)
>  at 
> org.apache.hadoop.yarn.server.resourcemanager.rmapp.TestRMAppTransitions.testAppRunningKill(TestRMAppTransitions.java:646)
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to