YARN-6450. TestContainerManagerWithLCE requires override for each new test added to ContainerManagerTest? Contributed by Jason Lowe.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e2d6656e Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e2d6656e Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e2d6656e Branch: refs/heads/HDFS-10467 Commit: e2d6656e274c5c423532bd6995a294832e439ad8 Parents: d2f889b Author: Eric Payne <[email protected]> Authored: Wed Apr 12 10:20:08 2017 -0500 Committer: Inigo <[email protected]> Committed: Mon Apr 17 11:17:02 2017 -0700 ---------------------------------------------------------------------- .../TestContainerManagerWithLCE.java | 310 +------------------ 1 file changed, 3 insertions(+), 307 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/e2d6656e/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestContainerManagerWithLCE.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestContainerManagerWithLCE.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestContainerManagerWithLCE.java index 5dc4717..028db6a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestContainerManagerWithLCE.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestContainerManagerWithLCE.java @@ -30,6 +30,7 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.server.nodemanager.containermanager.TestContainerManager; import org.junit.After; +import org.junit.Assume; public class TestContainerManagerWithLCE extends TestContainerManager { @@ -51,11 +52,8 @@ public class TestContainerManagerWithLCE extends TestContainerManager { @Override public void setup() throws IOException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } + Assume.assumeTrue("LCE binary path is not passed. Not running the test", + shouldRunTest()); super.setup(); localFS.setPermission(new Path(localDir.getCanonicalPath()), new FsPermission( @@ -73,308 +71,6 @@ public class TestContainerManagerWithLCE extends TestContainerManager { } } - @Override - public void testContainerSetup() throws Exception, InterruptedException, - YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerSetup"); - super.testContainerSetup(); - } - - @Override - public void testContainerManagerInitialization() throws IOException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerManagerInitialization"); - super.testContainerManagerInitialization(); - } - - @Override - public void testContainerLaunchAndStop() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerLaunchAndStop"); - super.testContainerLaunchAndStop(); - } - - @Override - public void testContainerLaunchAndExitSuccess() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerLaunchAndExitSuccess"); - super.testContainerLaunchAndExitSuccess(); - } - - @Override - public void testContainerLaunchAndExitFailure() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerLaunchAndExitFailure"); - super.testContainerLaunchAndExitFailure(); - } - - @Override - public void testLocalingResourceWhileContainerRunning() - throws Exception { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - super.testLocalingResourceWhileContainerRunning(); - } - - @Override - public void testLocalFilesCleanup() throws InterruptedException, - IOException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testLocalFilesCleanup"); - super.testLocalFilesCleanup(); - } - - @Override - public void testContainerLaunchFromPreviousRM() throws InterruptedException, - IOException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerLaunchFromPreviousRM"); - super.testContainerLaunchFromPreviousRM(); - } - - @Override - public void testMultipleContainersLaunch() throws Exception { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerLaunchFromPreviousRM"); - super.testMultipleContainersLaunch(); - } - - @Override - public void testMultipleContainersStopAndGetStatus() throws Exception { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerLaunchFromPreviousRM"); - super.testMultipleContainersStopAndGetStatus(); - } - - @Override - public void testUnauthorizedRequests() throws IOException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testUnauthorizedRequests"); - super.testUnauthorizedRequests(); - } - - @Override - public void testStartContainerFailureWithUnknownAuxService() throws Exception { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerLaunchFromPreviousRM"); - super.testStartContainerFailureWithUnknownAuxService(); - } - - @Override - public void testIncreaseContainerResourceWithInvalidRequests() throws Exception { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testIncreaseContainerResourceWithInvalidRequests"); - super.testIncreaseContainerResourceWithInvalidRequests(); - } - - @Override - public void testIncreaseContainerResourceWithInvalidResource() throws Exception { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testIncreaseContainerResourceWithInvalidResource"); - super.testIncreaseContainerResourceWithInvalidResource(); - } - - @Override - public void testChangeContainerResource() throws Exception { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testChangeContainerResource"); - super.testChangeContainerResource(); - } - - @Override - public void testOutputThreadDumpSignal() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testOutputThreadDumpSignal"); - super.testOutputThreadDumpSignal(); - } - - @Override - public void testGracefulShutdownSignal() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testGracefulShutdownSignal"); - super.testGracefulShutdownSignal(); - } - - @Override - public void testForcefulShutdownSignal() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testForcefulShutdownSignal"); - super.testForcefulShutdownSignal(); - } - - @Override - public void testContainerUpgradeSuccessAutoCommit() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerUpgradeSuccessAutoCommit"); - super.testContainerUpgradeSuccessAutoCommit(); - } - - @Override - public void testContainerUpgradeLocalizationFailure() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerUpgradeLocalizationFailure"); - super.testContainerUpgradeLocalizationFailure(); - } - - @Override - public void testContainerUpgradeSuccessExplicitCommit() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerUpgradeSuccessExplicitCommit"); - super.testContainerUpgradeSuccessExplicitCommit(); - } - - @Override - public void testContainerUpgradeSuccessExplicitRollback() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerUpgradeSuccessExplicitRollback"); - super.testContainerUpgradeSuccessExplicitRollback(); - } - - @Override - public void testContainerUpgradeRollbackDueToFailure() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerUpgradeRollbackDueToFailure"); - super.testContainerUpgradeRollbackDueToFailure(); - } - - @Override - public void testContainerUpgradeProcessFailure() throws IOException, - InterruptedException, YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerUpgradeProcessFailure"); - super.testContainerUpgradeProcessFailure(); - } - - @Override - public void testContainerRestart() throws IOException, InterruptedException, - YarnException { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testContainerRestart"); - super.testContainerRestart(); - } - - @Override - public void testStartContainerFailureWithInvalidLocalResource() throws Exception { - // Don't run the test if the binary is not available. - if (!shouldRunTest()) { - LOG.info("LCE binary path is not passed. Not running the test"); - return; - } - LOG.info("Running testStartContainerFailureWithInvalidLocalResource"); - super.testStartContainerFailureWithInvalidLocalResource(); - } - private boolean shouldRunTest() { return System .getProperty(YarnConfiguration.NM_LINUX_CONTAINER_EXECUTOR_PATH) != null; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
