commit 0998af01df4b221793f7799922a4b088d951d39a Author: Michael Stack Date: Tue Nov 8 12:36:23 2016 -0800 Revert "Revert "HBASE-16983 TestMultiTableSnapshotInputFormat failing with Unable to create region directory: /tmp/... (Addendum by Guanghao Zhang)"" This is a revert of a revert, i.e. puts back the change only I added HBaseCommonTestingUtility#getRandomDir from branch-1 too since missing in master branch. This reverts commit 9afcb4366d0098c42f2ea7c5da5aed02464bda63. diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java index 3cae4d2..0bf8aea 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java @@ -108,10 +108,7 @@ public class HBaseCommonTestingUtility { dataTestDir.getAbsolutePath()); return null; } - - String randomStr = UUID.randomUUID().toString(); - Path testPath = new Path(getBaseTestDir(), randomStr); - + Path testPath = getRandomDir(); this.dataTestDir = new File(testPath.toString()).getAbsoluteFile(); // Set this property so if mapreduce jobs run, they will use this as their home dir. System.setProperty("test.build.dir", this.dataTestDir.toString()); @@ -122,6 +119,14 @@ public class HBaseCommonTestingUtility { return testPath; } + /** + * @return A dir with a random (uuid) name under the test dir + * @see #getBaseTestDir() + */ + public Path getRandomDir() { + return new Path(getBaseTestDir(), UUID.randomUUID().toString()); + } + protected void createSubDir(String propertyName, Path parent, String subDirName) { Path newPath = new Path(parent, subDirName); File newDir = new File(newPath.toString()).getAbsoluteFile(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java index c762180..41e6780 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java @@ -64,8 +64,7 @@ public class TestMultiTableSnapshotInputFormat extends MultiTableInputFormatTest @Before public void setUp() throws Exception { - this.restoreDir = TEST_UTIL.getDataTestDir(); - + this.restoreDir = TEST_UTIL.getRandomDir(); } @Override