SLIDER-350 error in test cleanup when file in use on windows

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

Branch: refs/heads/feature/SLIDER-149_Support_a_YARN_service_registry
Commit: b3a835ddc5182d2c82c8355ad5deba86f6063174
Parents: 4ff287b
Author: Steve Loughran <ste...@apache.org>
Authored: Fri Aug 22 15:14:56 2014 +0100
Committer: Steve Loughran <ste...@apache.org>
Committed: Fri Aug 22 15:14:56 2014 +0100

----------------------------------------------------------------------
 .../org/apache/slider/agent/AgentMiniClusterTestBase.groovy | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b3a835dd/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
----------------------------------------------------------------------
diff --git 
a/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
 
b/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
index 74f7a3f..a957481 100644
--- 
a/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
+++ 
b/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
@@ -80,8 +80,13 @@ extends YarnZKMiniClusterTestBase {
 
   @AfterClass
   public static void cleanSubConfFiles() {
-    if (tempFolder.getRoot().exists()) {
-      FileUtils.deleteDirectory(tempFolder.getRoot());
+    def tempRoot = tempFolder.root
+    if (tempRoot.exists()) {
+      try {
+        FileUtils.deleteDirectory(tempRoot);
+      } catch (IOException e) {
+        log.warn("Failed to delete $tempRoot :$e", e)
+      }
     }
   }
 

Reply via email to