Uploaded image for project: 'GeoServer'
  1. GEOS-8122

Intermittent failure of FileUtils.deleteDirectory in SystemTestData.tearDown

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.12-beta
    • Fix Version/s: 2.10.4, 2.11.1, 2.12-beta
    • Component/s: Main
    • Labels:
      None

      Description

      We often see failures of FileUtils.deleteDirectory in SystemTestData.tearDown in builds.

      http://ares.boundlessgeo.com/jenkins/job/geoserver-master/4638/consoleText

      org.geoserver.wfs.v2_0.GetFeatureJoinTest  Time elapsed: 56 sec  <<< ERROR!
      java.io.IOException: Unable to delete directory ./target/default6619173959064498977data.
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1337)
      	at org.geoserver.data.test.SystemTestData.tearDown(SystemTestData.java:1026)
      	at org.geoserver.test.GeoServerBaseTestSupport.doTearDownClass(GeoServerBaseTestSupport.java:206)
      

      http://ares.boundlessgeo.com/jenkins/job/geoserver-master/4672/consoleText

      ests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.075 sec <<< FAILURE!
      org.geoserver.wps.web.ProcessStatusPageTest  Time elapsed: 6072 sec  <<< ERROR!
      java.io.IOException: Unable to delete directory ./target/default5475053532950449796data/temp/wps/e4fa42c3-fd2a-48f0-ae6b-d83fb7ec34d6.
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1337)
      	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1910)
      	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1399)
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1331)
      	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1910)
      	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1399)
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1331)
      	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1910)
      	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1399)
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1331)
      	at org.geoserver.data.test.SystemTestData.tearDown(SystemTestData.java:1026)
      	at org.geoserver.test.GeoServerBaseTestSupport.doTearDownClass(GeoServerBaseTestSupport.java:206)
      

      http://ares.boundlessgeo.com/jenkins/job/geoserver-master/4674/consoleText

      Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.975 sec <<< FAILURE!
      org.geoserver.netcdf.NetCDFGetFeatureInfoTest  Time elapsed: 7972 sec  <<< ERROR!
      java.io.IOException: Unable to delete directory ./target/default8989027234526976461data.
      	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1337)
      	at org.geoserver.data.test.SystemTestData.tearDown(SystemTestData.java:1026)
      	at org.geoserver.test.GeoServerBaseTestSupport.doTearDownClass(GeoServerBaseTestSupport.java:206)
      

      These failures are hard to reproduce locally, but running org.geoserver.wfs.v2_0.GetFeatureJoinTest in Eclipse reveals files like src/wfs/target/default7740998516718894422data/foo.2.log.db that are not cleaned. This indicates that data stores (in this case H2) are still writing to the data directory location and have not been disposed. Adding a breakpoint shows that CatalogImpl.dispose is never hit. Furthermore GeoServerImpl.dispose() is never called. The fix is to add a call to GeoServer.dispose() in GeoServerSystemTestSupport.destroyGeoServer() to ensure that all data stores are disposed before the data directory is removed. This change prevents the stale H2 cruft foo.2.log.db from being left behind when running org.geoserver.wfs.v2_0.GetFeatureJoinTest in Eclipse. It also causes new GWCIntegrationTest and GWCDataSecurityTest failures, under investigation.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                bencaradocdavies Ben Caradoc-Davies
                Reporter:
                bencaradocdavies Ben Caradoc-Davies
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Stride room