Andrea, I do not think that this can be ascribed to precision problems unless File.lastModified() on Windows is unstable.
The test compares the File.lastModified() of the resource obtained directly with the File.lastModified() of the same resource, encoded in JSON, HTML, and XML responses. Both timestamps are obtained via the same File.lastModified() code path on the same platform. As the test file is created once and then only read, it is surprising that its lastModified would change on any platform. Some sort of caching, an automated process, or virtual machine time adjustment, perhaps? I am open to suggestions. Kind regards, Ben. On 17/02/16 21:25, Andrea Aime wrote: > Hi Ben, > could it be related to windows often having a more granular "last file > modification" > time than linux (this really depends on the file system in use, but still): > > http://www.coderanch.com/t/384700/java/java/File-lastModified-windows-linux > > Long story short, I'm wondering if the test can be modified to ignore that > difference > > Cheers > Andrea > > > On Wed, Feb 17, 2016 at 7:50 AM, Ben Caradoc-Davies <b...@transient.nz> > wrote: > >> Niels, >> >> probably fixed on master: >> >> https://github.com/geoserver/geoserver/commit/3f26c66017e665b9ebbfc2b14f8f196371104ac8 >> >> I say probably because the first subsequent build had a different >> failure: the response lastModified was 15 milliseconds later than the >> resource lastModified. Some sort of intermittent Windows problem? Or a >> caching issue? The current build has passed this point, but the failure >> may recur. A single failure does not justify a Jira issue, so here you go: >> >> Failed tests: >> testDirectoryXML(org.geoserver.rest.resources.ResourceTest): >> expected:<...016-02-17 05:45:40.4[43] UTC> but was:<...016-02-17 >> 05:45:40.4[58] UTC> >> testDirectoryJSON(org.geoserver.rest.resources.ResourceTest): objects >> differed at key [ResourceDirectory];: objects differed at key >> [lastModified]; expected:<...016-02-17 05:45:40.5[52] UTC> but >> was:<...016-02-17 05:45:40.5[67] UTC> >> >> I will remove the -DquietTests=false, returning GeoServer-Master on >> winbuild to the state it was. >> >> Kind regards, >> Ben. >> >> On 17/02/16 18:16, Ben Caradoc-Davies wrote: >>> Aha! Revealing logged stack trace included below. >>> >>> Niels, at ResourceResource:275, instead of java.nio.file.Paths.get, did >>> you intend to use org.geoserver.platform.resource.Paths.path? Too many >>> Paths! >>> >>> This passes for me locally so I will push to master to see if it fixes >>> Windows. >>> >>> Kind regards, >>> Ben. >>> >>> >>> 17 feb 05:57:27 ERROR [geoserver.rest] - Exception intercepted >>> java.nio.file.InvalidPathException: UNC path is missing sharename: >> /\mydir >>> at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:118) >>> at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) >>> at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94) >>> at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255) >>> at java.nio.file.Paths.get(Paths.java:84) >>> at >>> >> org.geoserver.rest.resources.ResourceResource$1$1.wrapInternal(ResourceResource.java:275) >>> at >>> >> org.geoserver.rest.resources.ResourceResource$1$1.wrapInternal(ResourceResource.java:267) >>> at >>> >> org.geoserver.rest.format.ReflectiveHTMLFormat$ObjectToMapWrapper.wrap(ReflectiveHTMLFormat.java:335) >>> at >>> >> org.geoserver.rest.format.ReflectiveHTMLFormat$1.wrap(ReflectiveHTMLFormat.java:156) >>> at >>> >> freemarker.template.Template.createProcessingEnvironment(Template.java:356) >>> at freemarker.template.Template.process(Template.java:237) >>> at >>> >> org.restlet.ext.freemarker.TemplateRepresentation.write(TemplateRepresentation.java:112) >>> at >>> >> com.noelios.restlet.http.HttpServerCall.writeResponseBody(HttpServerCall.java:342) >>> at >>> >> com.noelios.restlet.http.HttpServerCall.sendResponse(HttpServerCall.java:306) >>> at >>> >> com.noelios.restlet.ext.servlet.ServletCall.sendResponse(ServletCall.java:306) >>> at >>> >> org.geoserver.rest.GeoServerServletConverter.commit(GeoServerServletConverter.java:54) >>> at >>> >> com.noelios.restlet.ext.servlet.ServletConverter.service(ServletConverter.java:130) >>> at >>> >> org.geoserver.rest.RESTDispatcher.handleRequestInternal(RESTDispatcher.java:87) >>> 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:933) >>> at >>> >> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:867) >>> at >>> >> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953) >>> at >>> >> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) >>> at >>> >> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >>> at >>> >> org.geoserver.test.GeoServerSystemTestSupport$1.service(GeoServerSystemTestSupport.java:1466) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >>> at >>> com.mockrunner.mock.web.MockFilterChain.doFilter(MockFilterChain.java:50) >>> at >>> >> org.geoserver.test.GeoServerSystemTestSupport.dispatch(GeoServerSystemTestSupport.java:1485) >>> at >>> >> org.geoserver.test.GeoServerSystemTestSupport.dispatch(GeoServerSystemTestSupport.java:1415) >>> at >>> >> org.geoserver.test.GeoServerSystemTestSupport.getAsServletResponse(GeoServerSystemTestSupport.java:949) >>> at >>> >> org.geoserver.test.GeoServerSystemTestSupport.getAsServletResponse(GeoServerSystemTestSupport.java:932) >>> at >>> >> org.geoserver.test.GeoServerSystemTestSupport.get(GeoServerSystemTestSupport.java:917) >>> at >>> >> org.geoserver.test.GeoServerSystemTestSupport.getAsDOM(GeoServerSystemTestSupport.java:1264) >>> at >>> >> org.geoserver.test.GeoServerSystemTestSupport.getAsDOM(GeoServerSystemTestSupport.java:1199) >>> at >>> >> org.geoserver.rest.resources.ResourceTest.testDirectoryHTML(ResourceTest.java:211) >>> [...] >>> [Fatal Error] :1:1: Premature end of file. >>> >>> >> >> -- >> Ben Caradoc-Davies <b...@transient.nz> >> Director >> Transient Software Limited <http://transient.nz/> >> New Zealand >> >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 >> _______________________________________________ >> Geoserver-devel mailing list >> Geoserver-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/geoserver-devel >> > > > -- Ben Caradoc-Davies <b...@transient.nz> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Geoserver-devel mailing list Geoserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-devel