From 6483342a61c80a7aacc50948962cda95c49c5031 Mon Sep 17 00:00:00 2001 From: junping_du Date: Thu, 2 Oct 2014 08:02:59 -0700 Subject: [PATCH] YARN-1979. TestDirectoryCollection fails when the umask is unusual. (Contributed by Vinod Kumar Vavilapalli and Tsuyoshi OZAWA) (cherry picked from commit c7cee9b4551918d5d35bf4e9dc73982a050c73ba) --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../server/nodemanager/TestDirectoryCollection.java | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 4e9ce1021cb..5165d7789f0 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -11,6 +11,9 @@ Release 2.7.0 - UNRELEASED IMPROVEMENTS + YARN-1979. TestDirectoryCollection fails when the umask is unusual. + (Vinod Kumar Vavilapalli and Tsuyoshi OZAWA via junping_du) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestDirectoryCollection.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestDirectoryCollection.java index 85287219884..f19731f1369 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestDirectoryCollection.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestDirectoryCollection.java @@ -31,9 +31,9 @@ import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.yarn.conf.YarnConfiguration; -import org.junit.AfterClass; +import org.junit.After; import org.junit.Assert; -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Test; public class TestDirectoryCollection { @@ -42,14 +42,14 @@ public class TestDirectoryCollection { TestDirectoryCollection.class.getName()).getAbsoluteFile(); private static final File testFile = new File(testDir, "testfile"); - @BeforeClass - public static void setup() throws IOException { + @Before + public void setup() throws IOException { testDir.mkdirs(); testFile.createNewFile(); } - @AfterClass - public static void teardown() { + @After + public void teardown() { FileUtil.fullyDelete(testDir); }