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

Jian He commented on YARN-7202:
-------------------------------

I'm just worried some ended up testing the ServiceClientForTest instead of real 
code. 
e.g. testBadGetService tests if a service exists or not, and check if the 
return code is NOT_FOUND. 
The test passes because in ServiceClientForTest it implements its own logic to 
throw IllegalArgumentException if service-name doesn't equal to the hardcode 
'jenkins'. But this is not the case for real code. In real code, it doesn't 
throw IllegalArgumentException if service is not found, it throws 
YarnException. and the return code won't be NOT_FOUND. So the test becomes moot 
in this scenario. 

May be mock particular method (like the rpc methods) instead of overriding the 
entire serviceClient ?



> End-to-end UT for api-server
> ----------------------------
>
>                 Key: YARN-7202
>                 URL: https://issues.apache.org/jira/browse/YARN-7202
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Jian He
>         Attachments: YARN-7202.yarn-native-services.001.patch, 
> YARN-7202.yarn-native-services.002.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to