From f6fe39ff1168d27f4d0ea3e4c7f3f17ecae9e1ab Mon Sep 17 00:00:00 2001 From: Sean Coffey Date: Wed, 20 Dec 2023 22:03:10 +0000 Subject: [PATCH] 8322078: ZipSourceCache.testKeySourceMapping() test fails with The process cannot access the file because it is being used by another process Reviewed-by: lancea --- test/jdk/java/util/zip/ZipFile/ZipSourceCache.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/jdk/java/util/zip/ZipFile/ZipSourceCache.java b/test/jdk/java/util/zip/ZipFile/ZipSourceCache.java index 8cb1051a87c..0f0b0725b7d 100644 --- a/test/jdk/java/util/zip/ZipFile/ZipSourceCache.java +++ b/test/jdk/java/util/zip/ZipFile/ZipSourceCache.java @@ -25,6 +25,7 @@ * @bug 8317678 * @modules java.base/java.util.zip:open * @summary Fix up hashCode() for ZipFile.Source.Key + * @library /test/lib * @run junit/othervm ZipSourceCache */ @@ -34,6 +35,7 @@ import java.nio.file.*; import java.nio.file.attribute.BasicFileAttributes; import java.util.*; import java.util.zip.*; +import jdk.test.lib.util.FileUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeAll; @@ -62,7 +64,7 @@ public class ZipSourceCache { @AfterAll public static void cleanup() throws IOException { - Files.deleteIfExists(Path.of(ZIPFILE_NAME)); + FileUtils.deleteFileIfExistsWithRetry(Path.of(ZIPFILE_NAME)); } /*