Repository: hadoop
Updated Branches:
  refs/heads/trunk 19560bb70 -> 1be05a362


HDDS-142. TestMetadataStore fails on Windows.
Contributed by  Íñigo Goiri.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1be05a36
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1be05a36
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1be05a36

Branch: refs/heads/trunk
Commit: 1be05a3623da22ed053ed9898df23c85981772e7
Parents: 19560bb
Author: Anu Engineer <[email protected]>
Authored: Fri Jun 1 14:21:35 2018 -0700
Committer: Anu Engineer <[email protected]>
Committed: Fri Jun 1 14:21:35 2018 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/ozone/TestMetadataStore.java | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/1be05a36/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/TestMetadataStore.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/TestMetadataStore.java
 
b/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/TestMetadataStore.java
index 6b26b60..a946c09 100644
--- 
a/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/TestMetadataStore.java
+++ 
b/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/TestMetadataStore.java
@@ -17,6 +17,8 @@
  */
 package org.apache.hadoop.ozone;
 
+import static org.apache.hadoop.test.PlatformAssumptions.assumeNotWindows;
+
 import com.google.common.collect.Lists;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.tuple.ImmutablePair;
@@ -81,6 +83,11 @@ public class TestMetadataStore {
 
   @Before
   public void init() throws IOException {
+    if (OzoneConfigKeys.OZONE_METADATA_STORE_IMPL_ROCKSDB.equals(storeImpl)) {
+      // The initialization of RocksDB fails on Windows
+      assumeNotWindows();
+    }
+
     testDir = GenericTestUtils.getTestDir(getClass().getSimpleName()
         + "-" + storeImpl.toLowerCase());
 
@@ -104,9 +111,13 @@ public class TestMetadataStore {
 
   @After
   public void cleanup() throws IOException {
-    store.close();
-    store.destroy();
-    FileUtils.deleteDirectory(testDir);
+    if (store != null) {
+      store.close();
+      store.destroy();
+    }
+    if (testDir != null) {
+      FileUtils.deleteDirectory(testDir);
+    }
   }
 
   private byte[] getBytes(String str) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to