Intermittent build failure caused by H2 log race with fixture data directory deletion

Description

Tests sometimes fail because H2 logs are written during fixture data directory deletion. I propose that we fix this by making unconditional use of the lenient branch of SystemTestData.deleteFilesOnExit on all platforms. Failure:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 org.geoserver.catalog.ResourcePoolTest Time elapsed: 56 sec <<< ERROR! java.lang.RuntimeException: java.io.IOException: Failed to delete tree ./target/default3332787525887648493data └──data └──h2test.2.log.db at org.geoserver.test.GeoServerBaseTestSupport$1.apply(GeoServerBaseTestSupport.java:97) at org.junit.rules.RunRules.applyAll(RunRules.java:26) at org.junit.rules.RunRules.<init>(RunRules.java:15) at org.junit.runners.BlockJUnit4ClassRunner.withTestRules(BlockJUnit4ClassRunner.java:379) at org.junit.runners.BlockJUnit4ClassRunner.withRules(BlockJUnit4ClassRunner.java:340) at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:256) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) Caused by: java.io.IOException: Failed to delete tree ./target/default3332787525887648493data └──data └──h2test.2.log.db at org.geoserver.data.test.SystemTestData.deleteFilesOnExit(SystemTestData.java:1106) at org.geoserver.data.test.SystemTestData.tearDown(SystemTestData.java:1094) at org.geoserver.test.GeoServerBaseTestSupport.doTearDownClass(GeoServerBaseTestSupport.java:189) at org.geoserver.test.GeoServerBaseTestSupport$1.apply(GeoServerBaseTestSupport.java:95) ... 27 more Caused by: java.io.IOException: Unable to delete directory ./target/default3332787525887648493data. at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1337) at org.geoserver.data.test.SystemTestData.deleteFilesOnExit(SystemTestData.java:1100) ... 30 more

Environment

Linux

Status

Assignee

Ben Caradoc-Davies

Reporter

Ben Caradoc-Davies

Triage

None

Fix versions

Affects versions

2.14-RC
2.12.4
2.13.1

Components

Priority

Medium