JDK-8169971 : JLinkMultiReleaseJarTest.java fails intermittently at the final clean up
  • Type: Bug
  • Component: tools
  • Sub-Component: jlink
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-11-18
  • Updated: 2017-07-12
  • Resolved: 2017-04-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 9
10Fixed 9 b166Fixed
Related Reports
Relates :  
Relates :  
Description
tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java fails intermittently with java.io.UncheckedIOException: java.nio.file.DirectoryNotEmptyException:

----------System.out:(76/5282)*----------
[TestNG] Running:
  tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java

config JLinkMultiReleaseJarTest.initialize(): success
test JLinkMultiReleaseJarTest.basicTest(): success
java.logging found in image

test JLinkMultiReleaseJarTest.loggingTest(): success
java.logging not found in image

test JLinkMultiReleaseJarTest.noLoggingTest(): success
config JLinkMultiReleaseJarTest.close(): failure
java.io.UncheckedIOException: java.nio.file.DirectoryNotEmptyException: C:\\Users\\aurora\\sandbox_keepme\\results\\run_74\\tier2\\JTwork\\jdk_test\\scratch\\1\\logging-image\\bin
	at JLinkMultiReleaseJarTest.lambda$close$6(JLinkMultiReleaseJarTest.java:153)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(java.base@9-ea/ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$2$1.accept(java.base@9-ea/ReferencePipeline.java:177)
	at java.util.stream.ReferencePipeline$3$1.accept(java.base@9-ea/ReferencePipeline.java:195)
	at java.util.Iterator.forEachRemaining(java.base@9-ea/Iterator.java:120)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(java.base@9-ea/Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(java.base@9-ea/AbstractPipeline.java:484)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(java.base@9-ea/AbstractPipeline.java:474)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(java.base@9-ea/ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(java.base@9-ea/ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(java.base@9-ea/AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(java.base@9-ea/ReferencePipeline.java:430)
	at JLinkMultiReleaseJarTest.close(JLinkMultiReleaseJarTest.java:145)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:537)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
	at org.testng.internal.TestMethodWorker.invokeAfterClassMethods(TestMethodWorker.java:220)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:773)
	at org.testng.TestRunner.run(TestRunner.java:623)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
	at org.testng.SuiteRunner.run(SuiteRunner.java:259)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
	at org.testng.TestNG.run(TestNG.java:1018)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:220)
	at jdk.internal.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:537)
	at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:226)
	at java.lang.Thread.run(java.base@9-ea/Thread.java:844)
Caused by: java.nio.file.DirectoryNotEmptyException: C:\\Users\\aurora\\sandbox_keepme\\results\\run_74\\tier2\\JTwork\\jdk_test\\scratch\\1\\logging-image\\bin
	at sun.nio.fs.WindowsFileSystemProvider.implDelete(java.base@9-ea/WindowsFileSystemProvider.java:267)
	at sun.nio.fs.AbstractFileSystemProvider.delete(java.base@9-ea/AbstractFileSystemProvider.java:105)
	at java.nio.file.Files.delete(java.base@9-ea/Files.java:1129)
	at jdk.testlibrary.FileUtils.deleteFileWithRetry0(FileUtils.java:103)
	at jdk.testlibrary.FileUtils.access$000(FileUtils.java:41)
	at jdk.testlibrary.FileUtils$1.postVisitDirectory(FileUtils.java:173)
	at jdk.testlibrary.FileUtils$1.postVisitDirectory(FileUtils.java:157)
	at java.nio.file.Files.walkFileTree(java.base@9-ea/Files.java:2713)
	at java.nio.file.Files.walkFileTree(java.base@9-ea/Files.java:2767)
	at jdk.testlibrary.FileUtils.deleteFileTreeUnchecked(FileUtils.java:157)
	at jdk.testlibrary.FileUtils.deleteFileTreeWithRetry(FileUtils.java:144)
	at JLinkMultiReleaseJarTest.lambda$close$6(JLinkMultiReleaseJarTest.java:148)
	... 39 more
	Suppressed: java.nio.file.DirectoryNotEmptyException: C:\\Users\\aurora\\sandbox_keepme\\results\\run_74\\tier2\\JTwork\\jdk_test\\scratch\\1\\logging-image
		... 51 more

===============================================
tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java
Total tests run: 3, Failures: 0, Skips: 0
Configuration Failures: 1, Skips: 0
===============================================

----------System.err:(22/1442)----------
warning - entry META-INF/versions/9/q/PublicClass.class is a public class in a concealed package, 
placing this jar on the class path will result in incompatible public interfaces
warning - entry: META-INF/versions/9/resource.txt, multiple resources with same name
warning - entry META-INF/versions/9/q/PublicClass.class is a public class in a concealed package, 
placing this jar on the class path will result in incompatible public interfaces
warning - entry: META-INF/versions/9/resource.txt, multiple resources with same name
warning - entry META-INF/versions/9/q/PublicClass.class is a public class in a concealed package, 
placing this jar on the class path will result in incompatible public interfaces
warning - entry: META-INF/versions/9/resource.txt, multiple resources with same name


java.lang.Exception: failures: 0
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:223)
	at jdk.internal.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:537)
	at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:226)
	at java.lang.Thread.run(java.base@9-ea/Thread.java:844)

JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 0


Comments
RFR: http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-April/047135.html
11-04-2017

The test defers to library methods Files.deleteFileTreeWithRetry if a directory and Files.deleteFileIfExistsWithRetry, those methods are failing. Specifically, Files.deleteFileTreeWithRetry does not appear to delete all files before the directory is deleted, or perhaps new files are created during the deletion process. The test also looks misguided in it's approach to deletion, since it also walks though the files of the test use dir and attempts to delete all of them. Files.deleteFileTreeWithRetry should be sufficient. Since this class creates files on a per-test basis, it might be possible to avoid deletion if those files are created in a per-test run area,
21-11-2016