From 4eacde67f8b57198447abfeab37f5115b6dbd556 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Mon, 7 Apr 2014 03:04:09 +0000 Subject: [PATCH] YARN-1905. TestProcfsBasedProcessTree must only run on Linux. Contributed by Chris Nauroth. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1585376 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 2 ++ .../hadoop/yarn/util/TestProcfsBasedProcessTree.java | 9 ++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 2f62b2e25e3..bba4ceded53 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -81,6 +81,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 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestProcfsBasedProcessTree.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestProcfsBasedProcessTree.java index 46da9b1eb43..771925574cd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestProcfsBasedProcessTree.java +++ b/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) {