HBASE-24226 Address other hard references to '/tmp' found in Configuration

This commit is contained in:
stack 2020-04-21 15:53:29 -07:00
parent 5c53b606a9
commit e7b5c34d28
2 changed files with 17 additions and 5 deletions

View File

@ -70,6 +70,17 @@ public class TestExportSnapshotAdjunct {
TestExportSnapshot.setUpBaseConf(TEST_UTIL.getConfiguration());
TEST_UTIL.startMiniCluster(3);
TEST_UTIL.startMiniMapReduceCluster();
}
/**
* Check for references to '/tmp'. We are trying to avoid having references to outside of the
* test data dir when running tests. References outside of the test dir makes it so concurrent
* tests can stamp on each other by mistake. This check is for references to the 'tmp'.
*
* This is a strange place for this test but I want somewhere where the configuration is
* full -- filed w/ hdfs and mapreduce configurations.
*/
private void checkForReferencesToTmpDir() {
Configuration conf = TEST_UTIL.getConfiguration();
for (Iterator<Map.Entry<String, String>> i = conf.iterator(); i.hasNext();) {
Map.Entry<String, String> e = i.next();

View File

@ -648,11 +648,11 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
setupClusterTestDir();
conf.set(TEST_DIRECTORY_KEY, clusterTestDir.getPath());
System.setProperty(TEST_DIRECTORY_KEY, clusterTestDir.getPath());
createDirAndSetProperty("test.cache.data", "test.cache.data");
createDirAndSetProperty("hadoop.tmp.dir", "hadoop.tmp.dir");
hadoopLogDir = createDirAndSetProperty("hadoop.log.dir", "hadoop.log.dir");
createDirAndSetProperty("mapreduce.cluster.local.dir", "mapreduce.cluster.local.dir");
createDirAndSetProperty("mapreduce.cluster.temp.dir", "mapreduce.cluster.temp.dir");
createDirAndSetProperty("test.cache.data");
createDirAndSetProperty("hadoop.tmp.dir");
hadoopLogDir = createDirAndSetProperty("hadoop.log.dir");
createDirAndSetProperty("mapreduce.cluster.local.dir");
createDirAndSetProperty("mapreduce.cluster.temp.dir");
enableShortCircuit();
Path root = getDataTestDirOnTestFS("hadoop");
@ -680,6 +680,7 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
createDirAndSetProperty("java.io.tmpdir");
createDirAndSetProperty("dfs.journalnode.edits.dir");
createDirAndSetProperty("dfs.provided.aliasmap.inmemory.leveldb.dir");
createDirAndSetProperty("fs.s3a.committer.staging.tmp.path");
}
/**