Browse Source

YARN-1905. Merging change r1585378 from branch-2 to branch-2.4

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.4@1585379 13f79535-47bb-0310-9956-ffa450edef68
Chris Nauroth 11 năm trước cách đây
mục cha
commit
6e7c3234a9

+ 2 - 0
hadoop-yarn-project/CHANGES.txt

@@ -18,6 +18,8 @@ Release 2.4.1 - UNRELEASED
     YARN-1837. Fixed TestMoveApplication#testMoveRejectedByScheduler failure.
     (Hong Zhiguo via jianhe)
 
+    YARN-1905. TestProcfsBasedProcessTree must only run on Linux. (cnauroth)
+
 Release 2.4.0 - 2014-04-07 
 
   INCOMPATIBLE CHANGES

+ 2 - 7
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestProcfsBasedProcessTree.java

@@ -20,6 +20,7 @@ package org.apache.hadoop.yarn.util;
 
 import static org.apache.hadoop.yarn.util.ProcfsBasedProcessTree.KB_TO_BYTES;
 import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
 
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
@@ -109,19 +110,13 @@ public class TestProcfsBasedProcessTree {
 
   @Before
   public void setup() throws IOException {
+    assumeTrue(Shell.LINUX);
     FileContext.getLocalFSFileContext().delete(
       new Path(TEST_ROOT_DIR.getAbsolutePath()), true);
   }
 
   @Test(timeout = 30000)
   public void testProcessTree() throws Exception {
-
-    if (!Shell.LINUX) {
-      System.out
-        .println("ProcfsBasedProcessTree is not available on this system. Not testing");
-      return;
-
-    }
     try {
       Assert.assertTrue(ProcfsBasedProcessTree.isAvailable());
     } catch (Exception e) {