From 96fd75bd0e0c6d73b3ed062d64edd28b24760472 Mon Sep 17 00:00:00 2001 From: Mingliang Liu Date: Wed, 19 Jun 2019 15:16:35 -0700 Subject: [PATCH] HBASE-22607. TestExportSnapshotNoCluster fails intermittently --- .../hbase/snapshot/TestExportSnapshotNoCluster.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotNoCluster.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotNoCluster.java index 8da5805ab4c..0340c8707e9 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotNoCluster.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotNoCluster.java @@ -17,8 +17,13 @@ */ package org.apache.hadoop.hbase.snapshot; +import static org.junit.Assert.assertTrue; + +import java.net.URI; + import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseCommonTestingUtility; @@ -64,8 +69,10 @@ public class TestExportSnapshotNoCluster { @BeforeClass public static void setUpBeforeClass() throws Exception { - testDir = TEST_UTIL.getDataTestDir(); + // Make sure testDir is on LocalFileSystem + testDir = TEST_UTIL.getDataTestDir().makeQualified(URI.create("file:///"), new Path("/")); fs = testDir.getFileSystem(TEST_UTIL.getConfiguration()); + assertTrue("FileSystem '" + fs + "' is not local", fs instanceof LocalFileSystem); setUpBaseConf(TEST_UTIL.getConfiguration()); }