diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index c678938cb40..b0eb86f24bd 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -582,6 +582,9 @@ Release 2.1.0-beta - UNRELEASED HADOOP-9581. hadoop --config non-existent directory should result in error (Ashwin Shankar via jlowe) + HADOOP-9638. Parallel test changes caused invalid test path for several HDFS + tests on Windows (Andrey Klochkov via cnauroth) + BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS HADOOP-8924. Hadoop Common creating package-info.java must not depend on diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java index 8f74b460507..2cf611fc70b 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java @@ -65,7 +65,13 @@ public abstract class FileContextMainOperationsBaseTest { public Path localFsRootPath; - protected final FileContextTestHelper fileContextTestHelper = new FileContextTestHelper(); + protected final FileContextTestHelper fileContextTestHelper = + createFileContextHelper(); + + protected FileContextTestHelper createFileContextHelper() { + return new FileContextTestHelper(); + } + protected static FileContext fc; final private static PathFilter DEFAULT_FILTER = new PathFilter() { diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextTestHelper.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextTestHelper.java index d40528b3082..f3753c3d9d0 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextTestHelper.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextTestHelper.java @@ -42,7 +42,15 @@ public final class FileContextTestHelper { * Create a context with test root relative to the /build/test/data */ public FileContextTestHelper() { - testRootDir = System.getProperty("test.build.data", "target/test/data") + "/" + RandomStringUtils.randomAlphanumeric(10); + this(System.getProperty("test.build.data", "target/test/data") + "/" + + RandomStringUtils.randomAlphanumeric(10)); + } + + /** + * Create a context with the given test root + */ + public FileContextTestHelper(String testRootDir) { + this.testRootDir = testRootDir; } public static int getDefaultBlockSize() { diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsBaseTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsBaseTest.java index 71894e6da97..0f771cd3ba5 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsBaseTest.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsBaseTest.java @@ -75,7 +75,11 @@ public class ViewFsBaseTest { Configuration conf; FileContext xfcViewWithAuthority; // same as fsView but with authority URI schemeWithAuthority; - final FileContextTestHelper fileContextTestHelper = new FileContextTestHelper(); + final FileContextTestHelper fileContextTestHelper = createFileContextHelper(); + + protected FileContextTestHelper createFileContextHelper() { + return new FileContextTestHelper(); + } @Before public void setUp() throws Exception { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsCreateMkdir.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsCreateMkdir.java index fe3054da775..40dbc4e88c9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsCreateMkdir.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsCreateMkdir.java @@ -38,6 +38,12 @@ public class TestFcHdfsCreateMkdir extends private static MiniDFSCluster cluster; private static Path defaultWorkingDirectory; + @Override + protected FileContextTestHelper createFileContextHelper() { + return new FileContextTestHelper("/tmp/TestFcHdfsCreateMkdir"); + } + + @BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsPermission.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsPermission.java index dc80205a6a8..9f0b23cedfe 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsPermission.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsPermission.java @@ -24,7 +24,6 @@ import java.net.URISyntaxException; import javax.security.auth.login.LoginException; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hdfs.HdfsConfiguration; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.security.UserGroupInformation; @@ -35,7 +34,8 @@ import org.junit.BeforeClass; public class TestFcHdfsPermission extends FileContextPermissionBase { - private static final FileContextTestHelper fileContextTestHelper = new FileContextTestHelper(); + private static final FileContextTestHelper fileContextTestHelper = + new FileContextTestHelper("/tmp/TestFcHdfsPermission"); private static FileContext fc; private static MiniDFSCluster cluster; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsSetUMask.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsSetUMask.java index 52f032dd933..b6833dabba7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsSetUMask.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsSetUMask.java @@ -42,7 +42,8 @@ import org.junit.Test; public class TestFcHdfsSetUMask { - private static FileContextTestHelper fileContextTestHelper = new FileContextTestHelper(); + private static FileContextTestHelper fileContextTestHelper = + new FileContextTestHelper("/tmp/TestFcHdfsSetUMask"); private static MiniDFSCluster cluster; private static Path defaultWorkingDirectory; private static FileContext fc; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsSymlink.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsSymlink.java index 2828cd0998f..c59c75db565 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsSymlink.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestFcHdfsSymlink.java @@ -50,7 +50,8 @@ public class TestFcHdfsSymlink extends FileContextSymlinkBaseTest { ((Log4JLogger)NameNode.stateChangeLog).getLogger().setLevel(Level.ALL); } - private static FileContextTestHelper fileContextTestHelper = new FileContextTestHelper(); + private static FileContextTestHelper fileContextTestHelper = + new FileContextTestHelper("/tmp/TestFcHdfsSymlink"); private static MiniDFSCluster cluster; private static WebHdfsFileSystem webhdfs; private static DistributedFileSystem dfs; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java index d1193f85ef8..6388bdd9e7a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java @@ -41,11 +41,15 @@ import org.junit.Test; public class TestHDFSFileContextMainOperations extends FileContextMainOperationsBaseTest { - private static FileContextTestHelper fileContextTestHelper = new FileContextTestHelper(); private static MiniDFSCluster cluster; private static Path defaultWorkingDirectory; private static HdfsConfiguration CONF = new HdfsConfiguration(); + @Override + protected FileContextTestHelper createFileContextHelper() { + return new FileContextTestHelper("/tmp/TestHDFSFileContextMainOperations"); + } + @BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsAtHdfsRoot.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsAtHdfsRoot.java index 0e35a4af7c1..27020d8f7ba 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsAtHdfsRoot.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsAtHdfsRoot.java @@ -23,6 +23,7 @@ import java.net.URISyntaxException; import javax.security.auth.login.LoginException; import org.apache.hadoop.fs.FileContext; +import org.apache.hadoop.fs.FileContextTestHelper; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RemoteIterator; @@ -43,6 +44,11 @@ public class TestViewFsAtHdfsRoot extends ViewFsBaseTest { private static HdfsConfiguration CONF = new HdfsConfiguration(); private static FileContext fc; + @Override + protected FileContextTestHelper createFileContextHelper() { + return new FileContextTestHelper("/tmp/TestViewFsAtHdfsRoot"); + } + @BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsHdfs.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsHdfs.java index 6d88eeb2dec..8761762c9bb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsHdfs.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsHdfs.java @@ -24,6 +24,7 @@ import java.net.URISyntaxException; import javax.security.auth.login.LoginException; import org.apache.hadoop.fs.FileContext; +import org.apache.hadoop.fs.FileContextTestHelper; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.HdfsConfiguration; @@ -39,6 +40,12 @@ public class TestViewFsHdfs extends ViewFsBaseTest { private static HdfsConfiguration CONF = new HdfsConfiguration(); private static FileContext fc; + @Override + protected FileContextTestHelper createFileContextHelper() { + return new FileContextTestHelper("/tmp/TestViewFsHdfs"); + } + + @BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java index 6ba605452c8..ad2352b3e00 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java @@ -51,6 +51,10 @@ public class TestFSMainOperationsWebHdfs extends FSMainOperationsBaseTest { private static Path defaultWorkingDirectory; private static FileSystem fileSystem; + public TestFSMainOperationsWebHdfs() { + super("/tmp/TestFSMainOperationsWebHdfs"); + } + @Override protected FileSystem createFileSystem() throws Exception { return fileSystem;