--- old/test/jdk/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java 2019-04-18 22:08:29.552305863 -0400 +++ new/test/jdk/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java 2019-04-18 22:08:28.648305879 -0400 @@ -193,6 +193,15 @@ 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