The build now fails on windows. I always see this error: expected: C:\Users\remko\AppData\Local\Temp\/hadoop.log Actual: C:\Users\remko\AppData\Local\Temp\/hadoop.log
java.nio.file.FileSystemException: C:\Users\remko\AppData\Local\Temp\hadoop.log: The process cannot access the file because it is being used by another process. at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108) at java.nio.file.Files.deleteIfExists(Files.java:1116) at org.apache.log4j.config.Log4j1ConfigurationFactoryTest.testSystemProperties1(Log4j1ConfigurationFactoryTest.java:173) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) On Sat, Nov 18, 2017 at 8:59 PM, <mi...@apache.org> wrote: > Repository: logging-log4j2 > Updated Branches: > refs/heads/master e962f82cf -> 5d7f784b4 > > > Always delete temporary file created in test > > > Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo > Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/ > commit/5d7f784b > Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5d7f784b > Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5d7f784b > > Branch: refs/heads/master > Commit: 5d7f784b4fecf086b545c2143a054c9ce5c9c301 > Parents: e962f82 > Author: Mikael Ståldal <mik...@staldal.nu> > Authored: Sat Nov 18 12:59:08 2017 +0100 > Committer: Mikael Ståldal <mik...@staldal.nu> > Committed: Sat Nov 18 12:59:08 2017 +0100 > > ---------------------------------------------------------------------- > .../log4j/config/Log4j1ConfigurationFactoryTest.java | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > ---------------------------------------------------------------------- > > > http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ > 5d7f784b/log4j-1.2-api/src/test/java/org/apache/log4j/config/ > Log4j1ConfigurationFactoryTest.java > ---------------------------------------------------------------------- > diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/config/ > Log4j1ConfigurationFactoryTest.java b/log4j-1.2-api/src/test/java/ > org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java > index ff1fa12..a5a8e67 100644 > --- a/log4j-1.2-api/src/test/java/org/apache/log4j/config/ > Log4j1ConfigurationFactoryTest.java > +++ b/log4j-1.2-api/src/test/java/org/apache/log4j/config/ > Log4j1ConfigurationFactoryTest.java > @@ -161,12 +161,15 @@ public class Log4j1ConfigurationFactoryTest { > > @Test > public void testSystemProperties1() throws Exception { > - final Configuration configuration = > getConfiguration("config-1.2/log4j-system-properties-1.properties"); > - final RollingFileAppender appender = > configuration.getAppender("RFA"); > final String tempFileName = System.getProperty("java.io.tmpdir") > + "/hadoop.log"; > - System.out.println("expected: " + tempFileName + " Actual: " + > appender.getFileName()); > - assertEquals(tempFileName, appender.getFileName()); > - Files.deleteIfExists(new File(tempFileName).toPath()); > + try { > + final Configuration configuration = > getConfiguration("config-1.2/log4j-system-properties-1.properties"); > + final RollingFileAppender appender = > configuration.getAppender("RFA"); > + System.out.println("expected: " + tempFileName + " Actual: " > + appender.getFileName()); > + assertEquals(tempFileName, appender.getFileName()); > + } finally { > + Files.deleteIfExists(new File(tempFileName).toPath()); > + } > } > > @Test > >