HBASE-22607. TestExportSnapshotNoCluster fails intermittently

This commit is contained in:
Mingliang Liu 2019-06-19 15:16:35 -07:00 committed by stack
parent 33bedf8d4d
commit 96fd75bd0e
1 changed files with 8 additions and 1 deletions

View File

@ -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());
}