You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2016/03/22 18:32:11 UTC

incubator-geode git commit: GEODE-912: Try a bit harder to delete the disk dirs

Repository: incubator-geode
Updated Branches:
  refs/heads/develop 57b00b12d -> 13a2c17e9


GEODE-912: Try a bit harder to delete the disk dirs


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/13a2c17e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/13a2c17e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/13a2c17e

Branch: refs/heads/develop
Commit: 13a2c17e970aa54cda3e6593fa40a903b81c26b6
Parents: 57b00b1
Author: Jens Deppe <jd...@pivotal.io>
Authored: Tue Mar 22 09:34:08 2016 -0700
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Tue Mar 22 09:34:08 2016 -0700

----------------------------------------------------------------------
 .../cli/commands/DiskStoreCommandsDUnitTest.java   | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/13a2c17e/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
index 826f128..d34242e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
@@ -54,7 +54,6 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
-
 import org.junit.Test;
 
 import java.io.File;
@@ -1145,13 +1144,25 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
 
   @Override
   protected final void preTearDownCliCommandTestBase() throws Exception {
-    for (String path : this.filesToBeDeleted) {
+    try {
+      deleteFiles();
+    } catch (IOException ex) {
+      // This sometimes throws a DirectoryNotEmptyException. The only reason I can see for this is that additional
+      // files are being written into the directory while it is being deleted (recursively). So let's just try one more
+      // time.
       try {
-        FileUtil.delete(new File(path));
+        deleteFiles();
       } catch (IOException e) {
         LogWriterUtils.getLogWriter().error("Unable to delete file", e);
       }
     }
     this.filesToBeDeleted.clear();
   }
+
+  private void deleteFiles() throws IOException {
+    for (String path : this.filesToBeDeleted) {
+      FileUtil.delete(new File(path));
+    }
+
+  }
 }