< prev index next >

test/jdk/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java

Print this page
rev 54612 : Checkpoint latest preliminary review patches for full OpenJDK review; merge with 8222295.patch.

@@ -191,10 +191,19 @@
             MethodHandle getVersion = MethodHandles.lookup()
                     .findVirtual(clazz, "getVersion", MethodType.methodType(int.class));
             int version = (int) getVersion.invoke(clazz.getConstructor().newInstance());
             Assert.assertEquals(version, JarFile.runtimeVersion().major());
         }
+        // Very rarely this test fails on Windows due to:
+        //     Error. failed to clean up files after test
+        // and this mesg shows the problem file (variable jimage):
+        //     Can't delete T:\\testOutput\\test-support\\jtreg_open_test_jdk_core_tools\\scratch\\0\\myimage\\lib\\modules
+        // The failure happens more with async monitor deflation
+        // so I think that an inflated monitor is keeping the above
+        // try-with-resources block from cleaning up in a timely
+        // fashion. Forcing a GC here appears to solve the problem.
+        System.gc();
     }
 
     @Test
     public void noLoggingTest() throws Throwable {
         if (ignoreTest()) return;
< prev index next >