From de1f0bf3e40b2aae7463017436a5a7b392511afe Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Mon, 21 Apr 2014 23:39:16 +0000 Subject: [PATCH] YARN-1970. Merging change r1589001 from trunk to branch-2. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1589004 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/hadoop/yarn/sls/utils/TestSLSUtils.java | 2 +- .../org/apache/hadoop/yarn/sls/web/TestSLSWebApp.java | 2 +- hadoop-yarn-project/CHANGES.txt | 2 ++ .../apache/hadoop/yarn/client/ProtocolHATestBase.java | 2 +- .../yarn/client/TestApplicationMasterServiceOnHA.java | 2 +- .../hadoop/yarn/client/TestResourceTrackerOnHA.java | 2 +- .../hadoop/yarn/server/resourcemanager/TestRMHA.java | 10 +++++++++- 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/utils/TestSLSUtils.java b/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/utils/TestSLSUtils.java index d643c77cf82..498615a7691 100644 --- a/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/utils/TestSLSUtils.java +++ b/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/utils/TestSLSUtils.java @@ -18,7 +18,7 @@ package org.apache.hadoop.yarn.sls.utils; -import junit.framework.Assert; +import org.junit.Assert; import org.junit.Test; public class TestSLSUtils { diff --git a/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/web/TestSLSWebApp.java b/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/web/TestSLSWebApp.java index 5060efaa04d..1c1e63cfd2c 100644 --- a/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/web/TestSLSWebApp.java +++ b/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/web/TestSLSWebApp.java @@ -18,7 +18,7 @@ package org.apache.hadoop.yarn.sls.web; -import junit.framework.Assert; +import org.junit.Assert; import org.apache.commons.io.FileUtils; import org.apache.hadoop.yarn.sls.SLSRunner; import org.junit.Test; diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 756c0aa38b4..172b3d4ac2f 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -41,6 +41,8 @@ Release 2.5.0 - UNRELEASED YARN-1870. FileInputStream is not closed in ProcfsBasedProcessTree#constructProcessSMAPInfo. (Fengdong Yu via junping_du) + YARN-1970. Prepare YARN codebase for JUnit 4.11. (cnauroth) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/ProtocolHATestBase.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/ProtocolHATestBase.java index 1f5bd058a91..15bfa28d20d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/ProtocolHATestBase.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/ProtocolHATestBase.java @@ -28,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import junit.framework.Assert; +import org.junit.Assert; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.ha.ClientBaseWithFixes; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestApplicationMasterServiceOnHA.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestApplicationMasterServiceOnHA.java index 13020e8ba41..4771ccba9db 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestApplicationMasterServiceOnHA.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestApplicationMasterServiceOnHA.java @@ -21,7 +21,7 @@ package org.apache.hadoop.yarn.client; import java.io.IOException; import java.util.ArrayList; -import junit.framework.Assert; +import org.junit.Assert; import org.apache.hadoop.io.Text; import org.apache.hadoop.ipc.RPC; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestResourceTrackerOnHA.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestResourceTrackerOnHA.java index 498dbe30035..363f6667f8e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestResourceTrackerOnHA.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestResourceTrackerOnHA.java @@ -20,7 +20,7 @@ package org.apache.hadoop.yarn.client; import java.io.IOException; -import junit.framework.Assert; +import org.junit.Assert; import org.apache.hadoop.ipc.RPC; import org.apache.hadoop.yarn.api.records.NodeId; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java index 5252f5620c9..eaf6e5de7e3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java @@ -28,7 +28,7 @@ import java.net.InetSocketAddress; import javax.ws.rs.core.MediaType; -import junit.framework.Assert; +import org.junit.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -37,6 +37,8 @@ import org.apache.hadoop.ha.HAServiceProtocol; import org.apache.hadoop.ha.HAServiceProtocol.HAServiceState; import org.apache.hadoop.ha.HAServiceProtocol.StateChangeRequestInfo; import org.apache.hadoop.ha.HealthCheckFailedException; +import org.apache.hadoop.metrics2.MetricsSystem; +import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem; import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.security.AccessControlException; import org.apache.hadoop.service.AbstractService; @@ -92,6 +94,12 @@ public class TestRMHA { // Enable webapp to test web-services also configuration.setBoolean(MockRM.ENABLE_WEBAPP, true); configuration.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true); + ClusterMetrics.destroy(); + QueueMetrics.clearQueueMetrics(); + MetricsSystem ms = DefaultMetricsSystem.instance(); + if (ms.getSource("ClusterMetrics") != null) { + DefaultMetricsSystem.shutdown(); + } } private void checkMonitorHealth() throws IOException {