Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevTest fails to cleanup directories on Windows builds #769

Open
dshimo opened this issue Jul 26, 2022 · 2 comments
Open

DevTest fails to cleanup directories on Windows builds #769

dshimo opened this issue Jul 26, 2022 · 2 comments

Comments

@dshimo
Copy link
Contributor

dshimo commented Jul 26, 2022

cleanUpAfterclass

image

Typically fails on Java 8 and Java 11, with no pattern for runtime or runtime version. Likely related to the updated Gradle wrapper used for Java 17 support.

@cherylking
Copy link
Member

Is it usually on the same test and file that it fails deletion? If so, can you include the full path of the file?

@dshimo
Copy link
Contributor Author

dshimo commented Jul 26, 2022

Yes. Here's an example of the full stack trace.

org.apache.commons.io.IOExceptionList: 3 exceptions: [java.io.IOException: Unable to delete file: build\testBuilds\dev-test\basic-dev-project1658857293670\build, java.io.IOException: Unable to delete file: build\testBuilds\dev-test\basic-dev-project1658857293670\output.log, java.io.IOException: Unable to delete file: build\testBuilds\dev-test\basic-dev-project1658857293670\stderr.log]
	at app//org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:345)
	at app//org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1206)
	at org.apache.commons.io.FileUtils$deleteDirectory$2.call(Unknown Source)
	at app//io.openliberty.tools.gradle.BaseDevTest.cleanUpAfterClass(BaseDevTest.groovy:272)
	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:566)
	at app//org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at app//groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at app//groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1550)
	at app//org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.callStatic(StaticMetaClassSite.java:62)
	at app//org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:55)
	at app//org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:217)
	at app//org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:231)
	at app//io.openliberty.tools.gradle.DevTest.cleanUpAfterClass(DevTest.groovy:284)
	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:566)
	at app//org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at app//org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at app//org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at app//org.junit.internal.runners.statements.RunAfters.invokeMethod(RunAfters.java:46)
	at app//org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
	at app//org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at app//org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:566)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:133)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: java.io.IOException: Unable to delete file: build\testBuilds\dev-test\basic-dev-project1658857293670\build
	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1425)
	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:338)
	... 49 more
Caused by: java.nio.file.FileSystemException: build\testBuilds\dev-test\basic-dev-project1658857293670\build\wlp\bin\tools\ws-javaagent.jar: The process cannot access the file because it is being used by another process.

	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:274)
	at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
	at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181)
	at org.apache.commons.io.file.DeletingPathVisitor.visitFile(DeletingPathVisitor.java:142)
	at org.apache.commons.io.file.DeletingPathVisitor.visitFile(DeletingPathVisitor.java:36)
	at java.base/java.nio.file.Files.walkFileTree(Files.java:2725)
	at java.base/java.nio.file.Files.walkFileTree(Files.java:2797)
	at org.apache.commons.io.file.PathUtils.visitFileTree(PathUtils.java:687)
	at org.apache.commons.io.file.PathUtils.deleteDirectory(PathUtils.java:328)
	at org.apache.commons.io.file.PathUtils.delete(PathUtils.java:303)
	at org.apache.commons.io.file.PathUtils.delete(PathUtils.java:280)
	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1423)
	... 50 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants