|
Sigh, this test is killing me. If you look at the test code, it starts with "if (!RemoteOWSTestSupport.isRemoteStatesAvailable()) return;" and isRemoteStatesAvailable() does exactly what you're saying, checks the resource is there and can be connected to, and even makes a full GetFeature request to make extra sure. Unfortunately:
So I don't know. It seems we have to give up running this test, since it fails on the build box too from time to time (so even the idea of OnlineTest cannot be applied). From one side, the functionality tested here (feature portrayal of a remote WFS data) is not commonly used, from the other side, for that very reason giving up these tests will just condem the functionality to become non functional in a short time (first wms refactor down the corner). Last famous words.... now the issue is reproducable within my eclipse (but strangely enough, not in Maven). (to bef fair, first time I run this one on Linux, maybe it's OS dependent?) So, it turns out Arne was loading Sigma with a stress test and many many connections, and Sigma was running out of them (max 256). A possibility would be to make these tests hit a GeoServer on the localhost, if it's not there, they pass. But we've already seen with the WFS datastore tests in GeoTools this is not a very good idea, as a unrelated GeoServer can be running in the same host (e.g., we cannot build GeoTools on Sigma because of this). This turns out to be my fault, I have been running performance tests against sigma in the past three days. I have been taking extra care that repo.opengeo.org remains fully functional throughout, but the Tomcat instance has been taking a beating. Is it at all possible to make these tests fail gracefully if the remote server is not responding? This test has broken the build, again. I am stealing this issue because I have written a patch. Attached patch adds a method to see if the RemoteOWS user style service is responding, and uses it in GetMapTest.testRemoteOWSUserStyleGet(). The patch also changes the logging from a static instance to an argument; this is required to obtain a correctly configured logger from AbstractGeoServerTestSupport (via its subclasses). A static logger cannot be used because initialisation is too early, and depends on class loading order. Patch committed r12471. Changes committed to fix the build. Andrea, I am assigning this back to you for review because you have already put a great deal of work into the robustness of these tests, and I know this GetMapTest failure has bugged you from time to time. I needed to fix the build so I have committed the patch. I apologise if this was hasty, but this failure has been around for a long time and has not been fixed. Please review the fix, and let me know if it is OK, or assign it back to Gabriel for review if you prefer. We still need to confirm that the test runs when sigma is responding. I have fixed the logging to facilitate this. To the best of my knowledge this will improve things but won't solve them. Sigma has this nasty tendency of answering positively to guarding check and refusing connection on the actual test when under load. Andrea, I have already applied the patch to fix the build. I agree that sigma is rather badly behaved, and also that this is not a complete fix. However, it should give us substantial symptomatic relief. I think GetMapTest is a useful test that covers real behaviour. However, it is difficult to refactor into an OnlineTestCase because of the indirect way in which it obtains its online resources. If you are happy with the (already applied) patch, great! If not, I can revert the change and exclude GetMapTest, unless you have a better idea (as you often have). The only reason I have submitted a patch for your review is in penance for committing to someone else's module, which in my view requires an apology, even if it was necessary to fix the build. Patch looks good, applied to the beta1 branch as well. Thanks. The best news is that sigma is now responding, and, if I run GetMapTest, I can see that the guard lets the remote style test body run, and the test succeeds. The last thing that could go wrong was that the guard was overzealous and stopped the test from testing anything, but this is not the case. With the fixes I made to logging, I can confirm that the test is running and producing output, so the original GetMapTest coverage is preserved. Unfortunately on my box I already got a build failure despite the patch being applied.. .sigh... A failure in GetMapTest? Nope, remote ows style something. Which right now works, but failed like 20 minutes ago Good morning Andrea. Recognise this one? Probably the easiest way to protect our sanity is to fix services on sigma, bringing it back up, and then keep this bug open but with reduced priority. For your convenience, here is the surefire report: ------------------------------------------------------------------------------- Test set: org.vfny.geoserver.wms.responses.map.png.GetMapTest ------------------------------------------------------------------------------- Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.614 sec <<< FAILURE! testRemoteOWSUserStyleGet(org.vfny.geoserver.wms.responses.map.png.GetMapTest) Time elapsed: 2.761 sec <<< FAILURE! junit.framework.ComparisonFailure: expected:<[image/png]> but was:<[application/vnd.ogc.se_xml]> at junit.framework.Assert.assertEquals(Assert.java:81) at junit.framework.Assert.assertEquals(Assert.java:87) at org.vfny.geoserver.wms.responses.map.png.GetMapTest.testRemoteOWSUserStyleGet(GetMapTest.java:154) And the Eclipse console: 21 Jan 09:54:21 ERROR [geotools.rendering] - Could not aquire feature:org.geotools.data.wfs.protocol.wfs.WFSException: WFS returned an exception. Target URL: http://sigma.openplans.org:8080/geoserver/wfs?. Originating request is: <?xml version="1.0" encoding="UTF-8"?> <wfs:GetFeature handle="GeoTools 2.7-SNAPSHOT WFS DataStore" outputFormat="text/xml; subtype=gml/3.1.1" resultType="results" service="WFS" version="1.1.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs"> <wfs:Query srsName="urn:x-ogc:def:crs:EPSG:4326" typeName="topp:states"> <wfs:PropertyName>the_geom</wfs:PropertyName> <ogc:Filter> <ogc:BBOX> <ogc:PropertyName>the_geom</ogc:PropertyName> <gml:Envelope> <gml:lowerCorner>-90.0 -180.0</gml:lowerCorner> <gml:upperCorner>90.0 180.0</gml:upperCorner> </gml:Envelope> </ogc:BBOX> </ogc:Filter> </wfs:Query> </wfs:GetFeature> [[java.lang.NullPointerException null]] java.util.NoSuchElementException: Could not aquire feature:org.geotools.data.wfs.protocol.wfs.WFSException: WFS returned an exception. Target URL: http://sigma.openplans.org:8080/geoserver/wfs?. Originating request is: <?xml version="1.0" encoding="UTF-8"?> <wfs:GetFeature handle="GeoTools 2.7-SNAPSHOT WFS DataStore" outputFormat="text/xml; subtype=gml/3.1.1" resultType="results" service="WFS" version="1.1.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs"> <wfs:Query srsName="urn:x-ogc:def:crs:EPSG:4326" typeName="topp:states"> <wfs:PropertyName>the_geom</wfs:PropertyName> <ogc:Filter> <ogc:BBOX> <ogc:PropertyName>the_geom</ogc:PropertyName> <gml:Envelope> <gml:lowerCorner>-90.0 -180.0</gml:lowerCorner> <gml:upperCorner>90.0 180.0</gml:upperCorner> </gml:Envelope> </ogc:BBOX> </ogc:Filter> </wfs:Query> </wfs:GetFeature> [[java.lang.NullPointerException null]] at org.geotools.data.store.NoContentIterator.next(NoContentIterator.java:56) at org.geotools.data.store.NoContentIterator.next(NoContentIterator.java:41) at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1854) at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1770) at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:690) at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:515) at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:387) at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:465) at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48) at org.geoserver.ows.Dispatcher.response(Dispatcher.java:711) at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:233) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.geoserver.test.GeoServerAbstractTestSupport.dispatch(GeoServerAbstractTestSupport.java:1054) at org.geoserver.test.GeoServerAbstractTestSupport.dispatch(GeoServerAbstractTestSupport.java:1021) at org.geoserver.test.GeoServerAbstractTestSupport.getAsServletResponse(GeoServerAbstractTestSupport.java:463) at org.vfny.geoserver.wms.responses.map.png.GetMapTest.testRemoteOWSUserStyleGet(GetMapTest.java:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at junit.framework.TestCase.runTest(TestCase.java:164) at org.geoserver.test.GeoServerAbstractTestSupport.runTest(GeoServerAbstractTestSupport.java:126) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:21) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:25) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.geotools.data.wfs.protocol.wfs.WFSException: WFS returned an exception. Target URL: http://sigma.openplans.org:8080/geoserver/wfs?. Originating request is: <?xml version="1.0" encoding="UTF-8"?> <wfs:GetFeature handle="GeoTools 2.7-SNAPSHOT WFS DataStore" outputFormat="text/xml; subtype=gml/3.1.1" resultType="results" service="WFS" version="1.1.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs"> <wfs:Query srsName="urn:x-ogc:def:crs:EPSG:4326" typeName="topp:states"> <wfs:PropertyName>the_geom</wfs:PropertyName> <ogc:Filter> <ogc:BBOX> <ogc:PropertyName>the_geom</ogc:PropertyName> <gml:Envelope> <gml:lowerCorner>-90.0 -180.0</gml:lowerCorner> <gml:upperCorner>90.0 180.0</gml:upperCorner> </gml:Envelope> </ogc:BBOX> </ogc:Filter> </wfs:Query> </wfs:GetFeature> [[java.lang.NullPointerException null]] at org.geotools.data.wfs.v1_1_0.parsers.ExceptionReportParser.parse(ExceptionReportParser.java:101) at org.geotools.data.wfs.protocol.wfs.WFSExtensions.process(WFSExtensions.java:75) at org.geotools.data.wfs.v1_1_0.WFS_1_1_0_DataStore.getFeatureReader(WFS_1_1_0_DataStore.java:325) at org.geotools.data.wfs.v1_1_0.WFSFeatureCollection.reader(WFSFeatureCollection.java:168) at org.geotools.data.store.DataFeatureCollection.openIterator(DataFeatureCollection.java:223) at org.geotools.data.store.DataFeatureCollection.iterator(DataFeatureCollection.java:193) at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1837) ... 43 more 21 Jan 09:54:21 ERROR [geoserver.ows] - org.vfny.geoserver.wms.WmsException: org.vfny.geoserver.wms.WmsException: Rendering process failed at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:486) at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48) at org.geoserver.ows.Dispatcher.response(Dispatcher.java:711) at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:233) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.geoserver.test.GeoServerAbstractTestSupport.dispatch(GeoServerAbstractTestSupport.java:1054) at org.geoserver.test.GeoServerAbstractTestSupport.dispatch(GeoServerAbstractTestSupport.java:1021) at org.geoserver.test.GeoServerAbstractTestSupport.getAsServletResponse(GeoServerAbstractTestSupport.java:463) at org.vfny.geoserver.wms.responses.map.png.GetMapTest.testRemoteOWSUserStyleGet(GetMapTest.java:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at junit.framework.TestCase.runTest(TestCase.java:164) at org.geoserver.test.GeoServerAbstractTestSupport.runTest(GeoServerAbstractTestSupport.java:126) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:21) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:25) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.vfny.geoserver.wms.WmsException: Rendering process failed at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:411) at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:465) ... 38 more Caused by: java.lang.Exception: Error rendering feature at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1862) at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1770) at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:690) at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:515) at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:387) ... 39 more Caused by: java.util.NoSuchElementException: Could not aquire feature:org.geotools.data.wfs.protocol.wfs.WFSException: WFS returned an exception. Target URL: http://sigma.openplans.org:8080/geoserver/wfs?. Originating request is: <?xml version="1.0" encoding="UTF-8"?> <wfs:GetFeature handle="GeoTools 2.7-SNAPSHOT WFS DataStore" outputFormat="text/xml; subtype=gml/3.1.1" resultType="results" service="WFS" version="1.1.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs"> <wfs:Query srsName="urn:x-ogc:def:crs:EPSG:4326" typeName="topp:states"> <wfs:PropertyName>the_geom</wfs:PropertyName> <ogc:Filter> <ogc:BBOX> <ogc:PropertyName>the_geom</ogc:PropertyName> <gml:Envelope> <gml:lowerCorner>-90.0 -180.0</gml:lowerCorner> <gml:upperCorner>90.0 180.0</gml:upperCorner> </gml:Envelope> </ogc:BBOX> </ogc:Filter> </wfs:Query> </wfs:GetFeature> [[java.lang.NullPointerException null]] at org.geotools.data.store.NoContentIterator.next(NoContentIterator.java:56) at org.geotools.data.store.NoContentIterator.next(NoContentIterator.java:41) at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1854) ... 43 more Caused by: org.geotools.data.wfs.protocol.wfs.WFSException: WFS returned an exception. Target URL: http://sigma.openplans.org:8080/geoserver/wfs?. Originating request is: <?xml version="1.0" encoding="UTF-8"?> <wfs:GetFeature handle="GeoTools 2.7-SNAPSHOT WFS DataStore" outputFormat="text/xml; subtype=gml/3.1.1" resultType="results" service="WFS" version="1.1.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs"> <wfs:Query srsName="urn:x-ogc:def:crs:EPSG:4326" typeName="topp:states"> <wfs:PropertyName>the_geom</wfs:PropertyName> <ogc:Filter> <ogc:BBOX> <ogc:PropertyName>the_geom</ogc:PropertyName> <gml:Envelope> <gml:lowerCorner>-90.0 -180.0</gml:lowerCorner> <gml:upperCorner>90.0 180.0</gml:upperCorner> </gml:Envelope> </ogc:BBOX> </ogc:Filter> </wfs:Query> </wfs:GetFeature> [[java.lang.NullPointerException null]] at org.geotools.data.wfs.v1_1_0.parsers.ExceptionReportParser.parse(ExceptionReportParser.java:101) at org.geotools.data.wfs.protocol.wfs.WFSExtensions.process(WFSExtensions.java:75) at org.geotools.data.wfs.v1_1_0.WFS_1_1_0_DataStore.getFeatureReader(WFS_1_1_0_DataStore.java:325) at org.geotools.data.wfs.v1_1_0.WFSFeatureCollection.reader(WFSFeatureCollection.java:168) at org.geotools.data.store.DataFeatureCollection.openIterator(DataFeatureCollection.java:223) at org.geotools.data.store.DataFeatureCollection.iterator(DataFeatureCollection.java:193) at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1837) ... 43 more Here is a patch to address this one once and for all. First I've simplified the tests to hit only demo.opengeo.org, which I can control and diagnose better in case of failure. Patch looks good to me. Committed on 2.0.x and trunk. By default the remote OWS tests won't be run, but I've configured the build server Does it work for everybody? |
|||||||||||||||||||||||||||||||||||||||
Need something (OnlineTestCase or otherwise) that checks that this is available (from remoteOws.sld):
<OnlineResource xlink:href="http://sigma.openplans.org:8080/geoserver/wfs?" />