You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by GitBox <gi...@apache.org> on 2020/11/30 08:44:15 UTC

[GitHub] [ambari-metrics] surajj-naik opened a new pull request #24: Fix TestTimelineWebServices to use JerseyTestBase

surajj-naik opened a new pull request #24:
URL: https://github.com/apache/ambari-metrics/pull/24


   Issue:
   ```
   Running org.apache.ambari.metrics.webapp.TestTimelineWebServicesTests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.294 sec <<< FAILURE! - in org.apache.ambari.metrics.webapp.TestTimelineWebServicestestAbout(org.apache.ambari.metrics.webapp.TestTimelineWebServices) 
   Time elapsed: 0.005 sec  
   <<< ERROR!com.sun.jersey.test.framework.spi.container.TestContainerException: java.net.BindException: Address already in use
   at org.apache.ambari.metrics.webapp.TestTimelineWebServices.<init>(TestTimelineWebServices.java:77)
   Caused by: java.net.BindException: Address already in useat org.apache.ambari.metrics.webapp.TestTimelineWebServices.<init>(TestTimelineWebServices.java:77)
   testGetMetrics(org.apache.ambari.metrics.webapp.TestTimelineWebServices)  
   Time elapsed: 0.001 sec  <<< ERROR!com.sun.jersey.test.framework.spi.container.TestContainerException: java.net.BindException: Address already in use
   at org.apache.ambari.metrics.webapp.TestTimelineWebServices.<init>(TestTimelineWebServices.java:77)
   Caused by: java.net.BindException: Address already in use
   at org.apache.ambari.metrics.webapp.TestTimelineWebServices.<init>(TestTimelineWebServices.java:77)
   Results :Tests in error:TestTimelineWebServices.<init>:77->JerseyTestBase.<init>:27->JerseyTest.<init>:217->JerseyTest.getContainer:342 » TestContainerTestTimelineWebServices.<init>:77->JerseyTestBase.<init>:27->JerseyTest.<init>:217->JerseyTest.getContainer:342 » TestContainer
   ```
   
   Fix:
   I am use the JerseyTestBase class from yarn that uses incremental port number to find the free port.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ambari-metrics] GauthamBanasandra commented on a change in pull request #24: AMBARI-25596: Multiple Ambari Unit Tests failing due to Address already in use

Posted by GitBox <gi...@apache.org>.
GauthamBanasandra commented on a change in pull request #24:
URL: https://github.com/apache/ambari-metrics/pull/24#discussion_r532690238



##########
File path: ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/webapp/TestTimelineWebServices.java
##########
@@ -75,28 +73,28 @@ protected Injector getInjector() {
 
   public TestTimelineWebServices() {
     super(new WebAppDescriptor.Builder(
-      "org.apache.ambari.metrics.webapp")
-      .contextListenerClass(GuiceServletConfig.class)
-      .filterClass(com.google.inject.servlet.GuiceFilter.class)
-      .contextPath("jersey-guice-filter")
-      .servletPath("/")
-      .clientConfig(new DefaultClientConfig(YarnJacksonJaxbJsonProvider.class))
-      .build());
+            "org.apache.ambari.metrics.webapp")
+            .contextListenerClass(GuiceServletConfig.class)
+            .filterClass(com.google.inject.servlet.GuiceFilter.class)
+            .contextPath("jersey-guice-filter")
+            .servletPath("/")
+            .clientConfig(new DefaultClientConfig(YarnJacksonJaxbJsonProvider.class))
+            .build());
   }
 
   @Test
   public void testAbout() throws Exception {
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("timeline")
-      .accept(MediaType.APPLICATION_JSON)
-      .get(ClientResponse.class);
+            .accept(MediaType.APPLICATION_JSON)

Review comment:
       I think you're using an indent width of 4 instead of 2.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ambari-metrics] surajj-naik commented on pull request #24: AMBARI-25596: Multiple Ambari Unit Tests failing due to Address already in use

Posted by GitBox <gi...@apache.org>.
surajj-naik commented on pull request #24:
URL: https://github.com/apache/ambari-metrics/pull/24#issuecomment-736238850


   @avijayanhwx not sure if you're the right person, but I only see your commits recently, if so, could you please review this. Thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ambari-metrics] surajj-naik commented on a change in pull request #24: AMBARI-25596: Multiple Ambari Unit Tests failing due to Address already in use

Posted by GitBox <gi...@apache.org>.
surajj-naik commented on a change in pull request #24:
URL: https://github.com/apache/ambari-metrics/pull/24#discussion_r533087931



##########
File path: ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/webapp/TestTimelineWebServices.java
##########
@@ -75,28 +73,28 @@ protected Injector getInjector() {
 
   public TestTimelineWebServices() {
     super(new WebAppDescriptor.Builder(
-      "org.apache.ambari.metrics.webapp")
-      .contextListenerClass(GuiceServletConfig.class)
-      .filterClass(com.google.inject.servlet.GuiceFilter.class)
-      .contextPath("jersey-guice-filter")
-      .servletPath("/")
-      .clientConfig(new DefaultClientConfig(YarnJacksonJaxbJsonProvider.class))
-      .build());
+            "org.apache.ambari.metrics.webapp")
+            .contextListenerClass(GuiceServletConfig.class)
+            .filterClass(com.google.inject.servlet.GuiceFilter.class)
+            .contextPath("jersey-guice-filter")
+            .servletPath("/")
+            .clientConfig(new DefaultClientConfig(YarnJacksonJaxbJsonProvider.class))
+            .build());
   }
 
   @Test
   public void testAbout() throws Exception {
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("timeline")
-      .accept(MediaType.APPLICATION_JSON)
-      .get(ClientResponse.class);
+            .accept(MediaType.APPLICATION_JSON)

Review comment:
       No, I checked, I am using proper indentation, seems like the continued lines are being indented by +2




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ambari-metrics] surajj-naik closed pull request #24: AMBARI-25596: Multiple Ambari Unit Tests failing due to Address already in use

Posted by GitBox <gi...@apache.org>.
surajj-naik closed pull request #24:
URL: https://github.com/apache/ambari-metrics/pull/24


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org