changeset 22044:2ec604347e5d

8022219: Intermittent test failures in java/util/zip/ZipFile Reviewed-by: alanb, chegar
author dxu
date Sat, 14 Dec 2013 16:37:49 -0800
parents e77b5937792c
children 8dc8af2df113
files jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java	Sat Dec 14 09:27:12 2013 +0000
+++ b/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java	Sat Dec 14 16:37:49 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /**
  * @test
  * @bug 6374379
+ * @library ../../../../lib/testlibrary
  * @summary Verify that we can read zip file names > 255 chars long
  */
 
@@ -31,6 +32,7 @@
 import java.util.jar.*;
 import java.util.zip.*;
 import java.util.Stack;
+import jdk.testlibrary.FileUtils;
 
 public class ReadLongZipFileName {
     private static String entryName = "testFile.txt";;
@@ -101,7 +103,12 @@
 
         while (! directories.empty()) {
             File f = directories.pop();
-            check(f.delete());
+            try {
+                FileUtils.deleteFileWithRetry(f.toPath());
+            } catch (IOException e) {
+                unexpected(e, "Fail to clean up directory, " + f);
+                break;
+            }
         }
     }