Updated Branches:
  refs/heads/master 8b94ee589 -> 6e663be20

Fixes filesystem tests sometimes failing on Windows.


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/6e663be2
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/6e663be2
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/6e663be2

Branch: refs/heads/master
Commit: 6e663be20abc3b8da6ef55da399f97158f13cb48
Parents: 8b94ee5
Author: Zack Shoylev <[email protected]>
Authored: Tue Nov 26 14:17:06 2013 -0600
Committer: Zack Shoylev <[email protected]>
Committed: Tue Nov 26 16:12:46 2013 -0600

----------------------------------------------------------------------
 .../src/main/java/org/jclouds/filesystem/util/Utils.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/6e663be2/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java
----------------------------------------------------------------------
diff --git 
a/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java 
b/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java
index 10c3b2a..7e3736c 100644
--- a/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java
+++ b/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java
@@ -18,6 +18,9 @@ package org.jclouds.filesystem.util;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+import com.google.common.util.concurrent.Uninterruptibles;
 
 /**
  * Utilities for the filesystem blobstore.
@@ -41,7 +44,11 @@ public class Utils {
          }
       }
       if (!file.delete()) {
-         throw new IOException("Could not delete: " + file);
+         // On windows, often the directory does not register as empty right 
away.
+         Uninterruptibles.sleepUninterruptibly(5, TimeUnit.SECONDS);
+         if(!file.delete()) {
+            throw new IOException("Could not delete: " + file);
+         }
       }
    }
 }

Reply via email to