[ https://issues.apache.org/jira/browse/YARN-7202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16197669#comment-16197669 ]
Eric Yang commented on YARN-7202: --------------------------------- [~jianhe] Thank you for the review. The new code enables the logic to be handled more accurately and provide better status report to down stream program weather the failure is caused by a bad request, record not found, or undetermined server errors. The previous implementation does not allow certain error to be surfaced correctly. This could lead to unclear or incorrect error messages. TestApiServer is unit test to make sure the REST API provide correct response codes in all conditions. It is mostly tested with negative test case where mocked ServiceClient will throw all kind of errors to ApiServer. This ensure all corner cases are handled correctly from REST API point of view. TestApiService is testing positive end to end integration test. Both type of tests should exist. There are javadoc description for TestApiServer and TestApiService. When the test jar file dependencies are removed. The tests fail on my side with class not found exception. {code} [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project hadoop-yarn-services-api: Compilation failure: Compilation failure: [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/ServiceClientTest.java:[29,45] cannot find symbol [ERROR] symbol: class YarnSolrClientTest [ERROR] location: package org.apache.hadoop.yarn.service.client [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiService.java:[26,45] cannot find symbol [ERROR] symbol: class ServiceTestUtils [ERROR] location: package org.apache.hadoop.yarn.service.client [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiService.java:[40,52] cannot find symbol [ERROR] symbol: class ServiceTestUtils [ERROR] location: package org.apache.hadoop.yarn.service.client [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiService.java:[40,1] static import only from classes and interfaces [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiService.java:[46,37] cannot find symbol [ERROR] symbol: class ServiceTestUtils [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiServer.java:[29,45] cannot find symbol [ERROR] symbol: class YarnSolrClientTest [ERROR] location: package org.apache.hadoop.yarn.service.client [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiServer.java:[44,27] cannot find symbol [ERROR] symbol: class MatcherAssert [ERROR] location: package org.hamcrest [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiServer.java:[44,1] static import only from classes and interfaces [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/ServiceClientTest.java:[57,15] cannot find symbol [ERROR] symbol: class YarnSolrClientTest [ERROR] location: class org.apache.hadoop.yarn.service.ServiceClientTest [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiService.java:[51,19] cannot find symbol [ERROR] symbol: variable NUM_NMS [ERROR] location: class org.apache.hadoop.yarn.service.TestApiService [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiService.java:[57,5] cannot find symbol [ERROR] symbol: method shutdown() [ERROR] location: class org.apache.hadoop.yarn.service.TestApiService [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiService.java:[125,24] cannot find symbol [ERROR] symbol: method createClient() [ERROR] location: class org.apache.hadoop.yarn.service.TestApiService [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiServer.java:[69,5] cannot find symbol [ERROR] symbol: class YarnSolrClientTest [ERROR] location: class org.apache.hadoop.yarn.service.TestApiServer [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiServer.java:[69,35] cannot find symbol [ERROR] symbol: class YarnSolrClientTest [ERROR] location: class org.apache.hadoop.yarn.service.TestApiServer [ERROR] /home/eyang/test/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/test/java/org/apache/hadoop/yarn/service/TestApiServer.java:[76,5] no suitable method found for assertThat(java.lang.String,boolean) [ERROR] method org.junit.Assert.<T>assertThat(java.lang.String,T,org.hamcrest.Matcher<? super T>) is not applicable [ERROR] (cannot infer type-variable(s) T [ERROR] (actual and formal argument lists differ in length)) [ERROR] method org.junit.Assert.<T>assertThat(T,org.hamcrest.Matcher<? super T>) is not applicable [ERROR] (cannot infer type-variable(s) T [ERROR] (argument mismatch; boolean cannot be converted to org.hamcrest.Matcher<? super T>)) [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException {code} Please check ~/.m2 cache, there might be cached pom.xml which made it appears as working. There is no direct inheritence that I can found in parent pom that expressed those dependencies. Hence, it is safer to declare them than sorry. We can file another JIRA to reorganize the structure to be: {code} hadoop-yarn/hadoop-yarn-applications + hadoop-yarn-services + hadoop-yarn-services-core + hadoop-yarn-services-api {code} And express the dependency of test jar file in hadoop-yarn-services. This will reduce the duplicates. > 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 > Assignee: Eric Yang > Attachments: YARN-7202.yarn-native-services.001.patch, > YARN-7202.yarn-native-services.002.patch, > YARN-7202.yarn-native-services.003.patch, > YARN-7202.yarn-native-services.004.patch, > YARN-7202.yarn-native-services.005.patch, > YARN-7202.yarn-native-services.006.patch, > YARN-7202.yarn-native-services.007.patch, > YARN-7202.yarn-native-services.008.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