You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Larry McCay (JIRA)" <ji...@apache.org> on 2016/01/25 17:24:39 UTC

[jira] [Commented] (KNOX-586) Fix instability in unit tests related to XForwardedHeaders

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

Larry McCay commented on KNOX-586:
----------------------------------

[~sumit.gupta] - Any status on this issue? If this has already been addressed can we get it resolved as fixed or alternatively moved out to Future?

> Fix instability in unit tests related to XForwardedHeaders
> ----------------------------------------------------------
>
>                 Key: KNOX-586
>                 URL: https://issues.apache.org/jira/browse/KNOX-586
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Tests
>    Affects Versions: 0.7.0
>            Reporter: Sumit Gupta
>            Assignee: Sumit Gupta
>             Fix For: 0.8.0
>
>
> As per discussion on the lists, the unit tests sometimes fail with the following errors:
> 2 expectations failed.
> Expected status code <200> doesn't match actual status code <500>.
> Expected content-type "application/json" doesn't match actual
> content-type "text/html;charset=ISO-8859-1".
> Stacktrace
> java.lang.AssertionError: 2 expectations failed.
> Expected status code <200> doesn't match actual status code <500>.
> Expected content-type "application/json" doesn't match actual
> content-type "text/html;charset=ISO-8859-1".
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> 	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
> 	at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71)
> 	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81)
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
> 	at com.jayway.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:399)
> 	at com.jayway.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate.call(Unknown
> Source)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl.invokeFilterChain(RequestSpecificationImpl.groovy:759)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl$invokeFilterChain.callCurrent(Unknown
> Source)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:1142)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl.this$2$applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl$this$2$applyPathParamsAndSendRequest.callCurrent(Unknown
> Source)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl.get(RequestSpecificationImpl.groovy:131)
> 	at com.jayway.restassured.specification.RequestSender$get.call(Unknown Source)
> 	at com.jayway.restassured.internal.ResponseSpecificationImpl.get(ResponseSpecificationImpl.groovy:226)
> 	at org.apache.hadoop.gateway.GatewayBasicFuncTest.testXForwardHeadersPopulate(GatewayBasicFuncTest.java:3265)
> Standard Error
> java.lang.AssertionError: Request GET
> http://127.0.0.1:34604/api/v1/topology/WordCount-1-1424792039 does not
> have the expected value for header X-Forwarded-Server
> Expected: is "localhost"
>      but: was "127.0.0.1"
> 	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
> 	at org.apache.hadoop.test.mock.MockRequestMatcher.match(MockRequestMatcher.java:217)
> 	at org.apache.hadoop.test.mock.MockServlet.service(MockServlet.java:46)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
> 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
> 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
> 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
> 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
> 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> 	at org.eclipse.jetty.server.Server.handle(Server.java:370)
> 	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
> 	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
> 	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
> 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
> 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
> 	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> 	at java.lang.Thread.run(Thread.java:724)
> and
> org.apache.hadoop.gateway.GatewayBasicFuncTest.testXForwardHeadersRewrite
> Failing for the past 1 build (Since [image: Unstable]#701
> <https://builds.apache.org/job/Knox-master-verify/org.apache.knox$gateway-test/701/>
> )
> Took 20 ms. <https://builds.apache.org/job/Knox-master-verify/org.apache.knox$gateway-test/701/testReport/junit/org.apache.hadoop.gateway/GatewayBasicFuncTest/testXForwardHeadersRewrite/history>
> Error Message
> 2 expectations failed.
> Expected status code <200> doesn't match actual status code <500>.
> Expected content-type "application/json" doesn't match actual
> content-type "text/html;charset=ISO-8859-1".
> Stacktrace
> java.lang.AssertionError: 2 expectations failed.
> Expected status code <200> doesn't match actual status code <500>.
> Expected content-type "application/json" doesn't match actual
> content-type "text/html;charset=ISO-8859-1".
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> 	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
> 	at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71)
> 	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
> 	at com.jayway.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:399)
> 	at com.jayway.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate.call(Unknown
> Source)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl.invokeFilterChain(RequestSpecificationImpl.groovy:759)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl$invokeFilterChain.callCurrent(Unknown
> Source)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:1142)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl.this$2$applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl$this$2$applyPathParamsAndSendRequest.callCurrent(Unknown
> Source)
> 	at com.jayway.restassured.internal.RequestSpecificationImpl.get(RequestSpecificationImpl.groovy:131)
> 	at com.jayway.restassured.specification.RequestSender$get.call(Unknown Source)
> 	at com.jayway.restassured.internal.ResponseSpecificationImpl.get(ResponseSpecificationImpl.groovy:226)
> 	at org.apache.hadoop.gateway.GatewayBasicFuncTest.testXForwardHeadersRewrite(GatewayBasicFuncTest.java:3317)
> Standard Error
> java.lang.AssertionError: Request GET
> http://127.0.0.1:34604/api/v1/topology/WordCount-1-1424792039 does not
> have the expected value for header X-Forwarded-Server
> Expected: is "localhost"
>      but: was "127.0.0.1"
> 	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
> 	at org.apache.hadoop.test.mock.MockRequestMatcher.match(MockRequestMatcher.java:217)
> 	at org.apache.hadoop.test.mock.MockServlet.service(MockServlet.java:46)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
> 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
> 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
> 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
> 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
> 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> 	at org.eclipse.jetty.server.Server.handle(Server.java:370)
> 	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
> 	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
> 	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
> 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
> 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
> 	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> 	at java.lang.Thread.run(Thread.java:724)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)