diff options
author | Anu Engineer <aengineer@apache.org> | 2018-06-01 14:21:35 -0700 |
---|---|---|
committer | Anu Engineer <aengineer@apache.org> | 2018-06-01 14:21:35 -0700 |
commit | 1be05a3623da22ed053ed9898df23c85981772e7 (patch) | |
tree | b45cc18b1a5fefc658195ea69978194fde4eb2d4 | |
parent | 19560bb70421fda094f3f2af09e67501099b7ab7 (diff) |
HDDS-142. TestMetadataStore fails on Windows.
Contributed by Íñigo Goiri.
-rw-r--r-- | hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/TestMetadataStore.java | 17 |
1 files changed, 14 insertions, 3 deletions
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 6b26b60350..a946c097a7 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) { |