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

Junping Du commented on YARN-1201:
----------------------------------

Kick off jenkins manually as resubmit a old patch won't trigger Jenkins' test.
The patch looks good to me overall. However, I think we'd better to improve 
code below:
{code}
+     return expected.isInstance(e) || (
+         e != null && isCause(expected, e.getCause());
{code}
if e is null, then it depends the behavior of isInstance(objectB) in JDK (some 
old version JDK will return true for this case, please refer: 
https://bugs.openjdk.java.net/browse/JDK-4081023, which suggest user to handle 
null case before calling this method). Thus, I think a more clear way to do is:
{code}
+     return e != null && (expected.isInstance(e) || isCause(expected, 
e.getCause());
{code}
Also, it is better to add some comments on new added method.

> TestAMAuthorization fails with local hostname cannot be resolved
> ----------------------------------------------------------------
>
>                 Key: YARN-1201
>                 URL: https://issues.apache.org/jira/browse/YARN-1201
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: resourcemanager
>    Affects Versions: 2.1.0-beta
>         Environment: SUSE Linux Enterprise Server 11 (x86_64)
>            Reporter: Nemon Lou
>            Assignee: Wangda Tan
>            Priority: Minor
>         Attachments: YARN-1201.patch, YARN-1201.patch, YARN-1201.patch, 
> YARN-1201.patch, YARN-1201.patch
>
>
> When hostname is 158-1-131-10, TestAMAuthorization fails.
> {code}
> Running org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization
> Tests run: 4, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 14.034 sec 
> <<< FAILURE! - in 
> org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization
> testUnauthorizedAccess[0](org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization)
>   Time elapsed: 3.952 sec  <<< ERROR!
> java.lang.NullPointerException: null
>         at 
> org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization.testUnauthorizedAccess(TestAMAuthorization.java:284)
> testUnauthorizedAccess[1](org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization)
>   Time elapsed: 3.116 sec  <<< ERROR!
> java.lang.NullPointerException: null
>         at 
> org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization.testUnauthorizedAccess(TestAMAuthorization.java:284)
> Results :
> Tests in error:
>   TestAMAuthorization.testUnauthorizedAccess:284 NullPointer
>   TestAMAuthorization.testUnauthorizedAccess:284 NullPointer
> Tests run: 4, Failures: 0, Errors: 2, Skipped: 0
> {code}



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

Reply via email to