SLIDER-33 Move masterless AM tests from HBase provider to slider-core
git-svn-id: https://svn.apache.org/repos/asf/incubator/slider/trunk@1594585 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/slider-core/src/main/java/org/apache/slider/common/SliderKeys.java b/slider-core/src/main/java/org/apache/slider/common/SliderKeys.java
index c1114a9..a0e29c9 100644
--- a/slider-core/src/main/java/org/apache/slider/common/SliderKeys.java
+++ b/slider-core/src/main/java/org/apache/slider/common/SliderKeys.java
@@ -137,6 +137,7 @@
String TMP_LOGDIR_PREFIX = "/tmp/slider-";
String TMP_DIR_PREFIX = "tmp";
+ String AM_DIR_PREFIX = "appmaster";
String SLIDER_JAR = "slider.jar";
String JCOMMANDER_JAR = "jcommander.jar";
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionStatusArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionStatusArgs.java
index 631ad86..a7edb65 100644
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionStatusArgs.java
+++ b/slider-core/src/main/java/org/apache/slider/common/params/ActionStatusArgs.java
@@ -32,9 +32,13 @@
@Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT},
description = "Output file for the configuration data")
- private String output;
+ public String output;
public String getOutput() {
return output;
}
+
+ public void setOutput(String output) {
+ this.output = output;
+ }
}
diff --git a/slider-core/src/main/java/org/apache/slider/common/tools/CoreFileSystem.java b/slider-core/src/main/java/org/apache/slider/common/tools/CoreFileSystem.java
index b14610f..dd934ce 100644
--- a/slider-core/src/main/java/org/apache/slider/common/tools/CoreFileSystem.java
+++ b/slider-core/src/main/java/org/apache/slider/common/tools/CoreFileSystem.java
@@ -153,11 +153,11 @@
*/
public void createClusterDirectories(InstancePaths instancePaths) throws
IOException, SliderException {
- Path clusterDirectory = instancePaths.instanceDir;
+ Path instanceDir = instancePaths.instanceDir;
- verifyDirectoryNonexistent(clusterDirectory);
+ verifyDirectoryNonexistent(instanceDir);
FsPermission clusterPerms = getInstanceDirectoryPermissions();
- createWithPermissions(clusterDirectory, clusterPerms);
+ createWithPermissions(instanceDir, clusterPerms);
createWithPermissions(instancePaths.snapshotConfPath, clusterPerms);
createWithPermissions(instancePaths.generatedConfPath, clusterPerms);
createWithPermissions(instancePaths.historyPath, clusterPerms);
diff --git a/slider-core/src/main/java/org/apache/slider/core/build/InstanceBuilder.java b/slider-core/src/main/java/org/apache/slider/core/build/InstanceBuilder.java
index 8918be8..06f3126 100644
--- a/slider-core/src/main/java/org/apache/slider/core/build/InstanceBuilder.java
+++ b/slider-core/src/main/java/org/apache/slider/core/build/InstanceBuilder.java
@@ -230,9 +230,9 @@
* @param appconfdir
*/
public void persist(Path appconfdir) throws
- IOException,
+ IOException,
SliderException,
- LockAcquireFailedException {
+ LockAcquireFailedException {
coreFS.createClusterDirectories(instancePaths);
ConfPersister persister =
new ConfPersister(coreFS, getInstanceDir());
diff --git a/slider-core/src/main/java/org/apache/slider/core/persist/ConfPersister.java b/slider-core/src/main/java/org/apache/slider/core/persist/ConfPersister.java
index ba47393..7e5925a 100644
--- a/slider-core/src/main/java/org/apache/slider/core/persist/ConfPersister.java
+++ b/slider-core/src/main/java/org/apache/slider/core/persist/ConfPersister.java
@@ -232,7 +232,7 @@
private void maybeExecLockHeldAction(LockHeldAction action) throws
- IOException,
+ IOException,
SliderException {
if (action != null) {
action.execute();
@@ -247,9 +247,9 @@
* @throws LockAcquireFailedException the lock could not be acquired
*/
public void save(AggregateConf conf, LockHeldAction action) throws
- IOException,
+ IOException,
SliderException,
- LockAcquireFailedException {
+ LockAcquireFailedException {
acquireWritelock();
try {
saveConf(conf);
@@ -268,10 +268,10 @@
* @throws LockAcquireFailedException the lock could not be acquired
*/
public void load(AggregateConf conf) throws
- FileNotFoundException,
- IOException,
+ FileNotFoundException,
+ IOException,
SliderException,
- LockAcquireFailedException {
+ LockAcquireFailedException {
boolean owner = acquireReadLock();
try {
loadConf(conf);
diff --git a/slider-core/src/main/java/org/apache/slider/core/persist/InstancePaths.java b/slider-core/src/main/java/org/apache/slider/core/persist/InstancePaths.java
index c0af279..df1206d 100644
--- a/slider-core/src/main/java/org/apache/slider/core/persist/InstancePaths.java
+++ b/slider-core/src/main/java/org/apache/slider/core/persist/InstancePaths.java
@@ -44,7 +44,7 @@
historyPath = new Path(instanceDir, SliderKeys.HISTORY_DIR_NAME);
dataPath = new Path(instanceDir, SliderKeys.DATA_DIR_NAME);
tmpPath = new Path(instanceDir, SliderKeys.TMP_DIR_PREFIX);
- tmpPathAM = new Path(tmpPath, "appmaster");
+ tmpPathAM = new Path(tmpPath, SliderKeys.AM_DIR_PREFIX);
}
@Override
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
index 8c01199..445d0a4 100644
--- a/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
@@ -28,6 +28,8 @@
import org.apache.slider.test.YarnZKMiniClusterTestBase
import org.junit.BeforeClass
+import javax.swing.ListModel
+
/**
* test base for agent clusters
*/
@@ -35,10 +37,10 @@
@Slf4j
public abstract class AgentMiniClusterTestBase
extends YarnZKMiniClusterTestBase {
- private static File agentConf
- private static File agentDef
- private static File imagePath
-
+ protected static File agentConf
+ protected static File agentDef
+ protected static File imagePath
+ protected static Map<String, String> agentDefOptions
@BeforeClass
public static void createSubConfFiles() {
@@ -50,7 +52,12 @@
agentDef.createNewFile()
File slider_dir = new File(new File(".").absoluteFile, "src/test/python");
imagePath = new File(slider_dir, "appdef_1.zip")
+ agentDefOptions = [
+ (AgentKeys.APP_DEF) : imagePath.toURI().toString(),
+ (AgentKeys.AGENT_CONF): agentConf.toURI().toString()
+ ]
}
+
@Override
public String getTestConfigurationPath() {
return "src/main/resources/" + AgentKeys.CONF_RESOURCE;
@@ -104,17 +111,37 @@
int size,
boolean deleteExistingData,
boolean blockUntilRunning) {
- return createCluster(clustername,
- [:],
- [
-
- ],
+ List<String> args = [];
+ return createMasterlessAMWithArgs(
+ clustername,
+ args,
deleteExistingData,
- blockUntilRunning,
- [
- (AgentKeys.APP_DEF): imagePath.toURI().toString(),
- (AgentKeys.AGENT_CONF): agentConf.toURI().toString()
- ])
+ blockUntilRunning)
}
-}
+/**
+ * Create an AM without a master
+ * @param clustername AM name
+ * @param extraArgs extra arguments
+ * @param size # of nodes
+ * @param deleteExistingData should any existing cluster data be deleted
+ * @param blockUntilRunning block until the AM is running
+ * @return launcher which will have executed the command.
+ */
+ public ServiceLauncher<SliderClient> createMasterlessAMWithArgs(
+ String clustername,
+ List<String> extraArgs,
+ boolean deleteExistingData,
+ boolean blockUntilRunning) {
+ if (hdfsCluster) {
+ fail("Agent tests do not (currently) work with mini HDFS cluster")
+ }
+ return createCluster(clustername,
+ [:],
+ extraArgs,
+ deleteExistingData,
+ blockUntilRunning,
+ agentDefOptions)
+ }
+
+}
\ No newline at end of file
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionExists.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionExists.groovy
similarity index 87%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionExists.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionExists.groovy
index b4a87f8..fefed8e 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionExists.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionExists.groovy
@@ -16,34 +16,36 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.actions
+package org.apache.slider.agent.actions
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
-import org.apache.slider.core.main.LauncherExitCodes
-import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.SliderActions
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
import org.apache.hadoop.yarn.api.records.ApplicationReport
import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
+import org.apache.slider.core.main.LauncherExitCodes
import org.apache.slider.core.main.ServiceLauncher
+import org.apache.slider.test.SliderTestUtils
+import org.junit.Assert
import org.junit.Before
import org.junit.Test
/**
- * Test of RM creation. This is so the later test's prereq's can be met
+ * existence tests
*/
@CompileStatic
@Slf4j
-class TestActionExists extends HBaseMiniClusterTestBase {
+class TestActionExists extends AgentMiniClusterTestBase {
@Before
public void setup() {
super.setup()
- createMiniCluster("TestActionExists", getConfiguration(), 1, false)
+ createMiniCluster("TestActionExists", configuration, 1, false)
}
@Test
@@ -60,7 +62,7 @@
Arguments.ARG_MANAGER, RMAddr
],
)
- fail("expected an exception, got a status code "+ launcher.serviceExitCode)
+ Assert.fail("expected an exception, got a status code "+ launcher.serviceExitCode)
} catch (UnknownApplicationInstanceException e) {
}
@@ -86,7 +88,7 @@
Arguments.ARG_MANAGER, RMAddr
],
)
- assertSucceeded(launcher)
+ SliderTestUtils.assertSucceeded(launcher)
//and when cluster is running
launcher = launchClientAgainstMiniMR(
@@ -101,7 +103,7 @@
],
)
- assertSucceeded(launcher)
+ SliderTestUtils.assertSucceeded(launcher)
// assert that the cluster exists
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionList.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionList.groovy
similarity index 79%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionList.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionList.groovy
index fd3d7e6..1849807 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionList.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionList.groovy
@@ -16,37 +16,50 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.actions
+package org.apache.slider.agent.actions
import groovy.util.logging.Slf4j
-import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.SliderActions
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
import org.apache.hadoop.yarn.api.records.ApplicationReport
import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
import org.apache.slider.core.main.ServiceLauncher
import org.junit.Before
import org.junit.Test
/**
- * Test of RM creation. This is so the later test's prereq's can be met
+ * Test List operations
*/
@Slf4j
-class TestActionList extends HBaseMiniClusterTestBase {
+class TestActionList extends AgentMiniClusterTestBase {
@Before
public void setup() {
super.setup()
- createMiniCluster("testActionList", getConfiguration(), 1, false)
+ createMiniCluster("testActionList", configuration, 1, false)
+ }
+
+ /**
+ * This is a test suite to run the tests against a single cluster instance
+ * for faster test runs
+ * @throws Throwable
+ */
+
+ @Test
+ public void testSuite() throws Throwable {
+ testListThisUserNoClusters()
+ testListAllUsersNoClusters()
+ testListLiveCluster()
+ testListMissingCluster()
}
- @Test
public void testListThisUserNoClusters() throws Throwable {
log.info("RM address = ${RMAddr}")
- ServiceLauncher launcher = launchClientAgainstMiniMR(
+ ServiceLauncher<SliderClient> launcher = launchClientAgainstMiniMR(
//config includes RM binding info
new YarnConfiguration(miniCluster.config),
//varargs list of command line params
@@ -56,13 +69,11 @@
]
)
assert launcher.serviceExitCode == 0
- SliderClient sliderClient = (SliderClient) launcher.service
}
- @Test
public void testListAllUsersNoClusters() throws Throwable {
log.info("RM address = ${RMAddr}")
- ServiceLauncher launcher = launchClientAgainstMiniMR(
+ ServiceLauncher<SliderClient> launcher = launchClientAgainstMiniMR(
//config includes RM binding info
new YarnConfiguration(miniCluster.config),
//varargs list of command line params
@@ -74,12 +85,14 @@
assert launcher.serviceExitCode == 0
}
- @Test
public void testListLiveCluster() throws Throwable {
//launch the cluster
String clustername = "test_list_live_cluster"
- ServiceLauncher launcher = createMasterlessAM(clustername, 0, true, false)
- ApplicationReport report = waitForClusterLive((SliderClient) launcher.service)
+ ServiceLauncher<SliderClient> launcher = createMasterlessAM(clustername, 0, true, false)
+ addToTeardown(launcher)
+ //do the low level operations to get a better view of what is going on
+ SliderClient sliderClient = launcher.service
+ waitForClusterLive(sliderClient)
//now list
launcher = launchClientAgainstMiniMR(
@@ -93,8 +106,7 @@
assert launcher.serviceExitCode == 0
//now look for the explicit sevice
- //do the low level operations to get a better view of what is going on
- SliderClient sliderClient = launcher.service
+
def serviceRegistryClient = sliderClient.YARNRegistryClient
ApplicationReport instance = serviceRegistryClient.findInstance(clustername)
assert instance != null
@@ -112,15 +124,10 @@
}
-
-
- @Test
public void testListMissingCluster() throws Throwable {
- describe("create exec the status command against an unknown cluster")
- //launch fake master
- //launch the cluster
- //exec the status command
- ServiceLauncher launcher
+ describe("exec the status command against an unknown cluster")
+
+ ServiceLauncher<SliderClient> launcher
try {
launcher = launchClientAgainstMiniMR(
//config includes RM binding info
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionStatus.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionStatus.groovy
similarity index 78%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionStatus.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionStatus.groovy
index cdd9fad..bdee39f 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionStatus.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionStatus.groovy
@@ -16,11 +16,14 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.actions
+package org.apache.slider.agent.actions
+import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
+import org.apache.slider.agent.AgentMiniClusterTestBase
import org.apache.slider.common.SliderExitCodes
import org.apache.slider.api.ClusterDescription
+import org.apache.slider.common.params.SliderActions
import org.apache.slider.core.exceptions.BadClusterStateException
import org.apache.slider.core.exceptions.ErrorStrings
import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
@@ -28,19 +31,19 @@
import org.apache.slider.client.SliderClient
import org.apache.slider.common.params.ActionStatusArgs
import org.apache.slider.common.params.ClientArgs
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
import org.apache.hadoop.yarn.api.records.ApplicationReport
import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.core.main.LauncherExitCodes
import org.apache.slider.core.main.ServiceLauncher
import org.junit.Before
import org.junit.Test
/**
- * Test of RM creation. This is so the later test's prereq's can be met
+ * status operations
*/
-//@CompileStatic
+@CompileStatic
@Slf4j
-class TestActionStatus extends HBaseMiniClusterTestBase {
+class TestActionStatus extends AgentMiniClusterTestBase {
@Before
public void setup() {
@@ -48,19 +51,26 @@
createMiniCluster("test_action_status", configuration, 1, false)
}
+ /**
+ * This is a test suite to run the tests against a single cluster instance
+ * for faster test runs
+ * @throws Throwable
+ */
+
@Test
+ public void testSuite() throws Throwable {
+ testStatusLiveCluster()
+ testStatusMissingCluster()
+ }
+
public void testStatusMissingCluster() throws Throwable {
describe("create exec the status command against an unknown cluster")
- //launch fake master
- //launch the cluster
- //exec the status command
+
try {
- ServiceLauncher launcher = launchClientAgainstMiniMR(
- //config includes RM binding info
+ ServiceLauncher<SliderClient> launcher = launchClientAgainstMiniMR(
new YarnConfiguration(miniCluster.config),
- //varargs list of command line params
[
- ClientArgs.ACTION_STATUS,
+ SliderActions.ACTION_STATUS,
"test_status_missing_cluster",
Arguments.ARG_MANAGER, RMAddr
]
@@ -72,25 +82,22 @@
}
- @Test
public void testStatusLiveCluster() throws Throwable {
describe("create a live cluster then exec the status command")
- //launch fake master
String clustername = "test_status_live_cluster"
//launch the cluster
- ServiceLauncher launcher = createMasterlessAM(clustername, 0, true, false)
+ ServiceLauncher<SliderClient> launcher = createMasterlessAM(clustername, 0, true, false)
- ApplicationReport report = waitForClusterLive(launcher.service)
+ SliderClient sliderClient = launcher.service
+ ApplicationReport report = waitForClusterLive(sliderClient)
- //do the low level operations to get a better view of what is going on
- SliderClient sliderClient = (SliderClient) launcher.service
//now look for the explicit sevice
ActionStatusArgs statusArgs = new ActionStatusArgs()
int status = sliderClient.actionStatus(clustername, statusArgs)
- assert status == SliderExitCodes.EXIT_SUCCESS
+ assert 0 == status
//now exec the status command
ServiceLauncher statusLauncher = launchClientAgainstMiniMR(
@@ -98,7 +105,7 @@
new YarnConfiguration(miniCluster.config),
//varargs list of command line params
[
- ClientArgs.ACTION_STATUS,
+ SliderActions.ACTION_STATUS,
clustername,
Arguments.ARG_MANAGER, RMAddr,
]
@@ -121,7 +128,7 @@
new YarnConfiguration(miniCluster.config),
//varargs list of command line params
[
- ClientArgs.ACTION_STATUS,
+ SliderActions.ACTION_STATUS,
clustername,
Arguments.ARG_MANAGER, RMAddr,
Arguments.ARG_OUTPUT, path
@@ -140,7 +147,8 @@
status = sliderClient.actionStatus(clustername, new ActionStatusArgs())
fail("expected an exception, but got the status $status")
} catch (BadClusterStateException e) {
- assert e.toString().contains(ErrorStrings.E_APPLICATION_NOT_RUNNING)
+ assertExceptionDetails(e, SliderExitCodes.EXIT_BAD_STATE,
+ ErrorStrings.E_APPLICATION_NOT_RUNNING)
}
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionVersion.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionVersion.groovy
similarity index 92%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionVersion.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionVersion.groovy
index 6525e3b..1d50b71 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/actions/TestActionVersion.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionVersion.groovy
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.actions
+package org.apache.slider.agent.actions
import groovy.util.logging.Slf4j
import org.apache.slider.common.params.SliderActions
@@ -33,11 +33,6 @@
class TestActionVersion extends YarnMiniClusterTestBase {
- @Before
- public void setup() {
- super.setup()
- }
-
@Test
public void testVersion() throws Throwable {
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeCommands.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestFreezeCommands.groovy
similarity index 61%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeCommands.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestFreezeCommands.groovy
index 76da362..9d41b8c 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeCommands.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestFreezeCommands.groovy
@@ -16,18 +16,19 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.minicluster.freezethaw
+package org.apache.slider.agent.freezethaw
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
-import org.apache.slider.core.main.LauncherExitCodes
-import org.apache.slider.core.exceptions.SliderException
+import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.client.SliderClient
import org.apache.slider.common.params.Arguments
import org.apache.slider.common.params.SliderActions
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
-import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.core.exceptions.SliderException
+import org.apache.slider.core.main.LauncherExitCodes
import org.apache.slider.core.main.ServiceLauncher
+import org.apache.slider.test.YarnMiniClusterTestBase
import org.junit.Test
/**
@@ -37,44 +38,50 @@
@CompileStatic
@Slf4j
-class TestFreezeCommands extends HBaseMiniClusterTestBase {
+class TestFreezeCommands extends AgentMiniClusterTestBase {
@Test
public void testFreezeCommands() throws Throwable {
String clustername = "test_freeze_commands"
- YarnConfiguration conf = getConfiguration()
- createMiniCluster(clustername, conf, 1, 1, 1, true, true)
+ YarnConfiguration conf = configuration
+ createMiniCluster(clustername, conf, 1, 1, 1, true, false)
describe "create a masterless AM, freeze it, try to freeze again"
- ServiceLauncher launcher = createMasterlessAM(clustername, 0, true, true);
- addToTeardown(launcher.service as SliderClient);
+ ServiceLauncher<SliderClient> launcher = createMasterlessAM(
+ clustername,
+ 0,
+ true,
+ true);
+ addToTeardown(launcher.service);
-
+
log.info("ListOp")
assertSucceeded(execSliderCommand(conf,
- [SliderActions.ACTION_LIST,clustername]))
-
+ [SliderActions.ACTION_LIST, clustername]))
+
log.info("First Freeze command");
ServiceLauncher freezeCommand = execSliderCommand(conf,
- [SliderActions.ACTION_FREEZE, clustername,
- Arguments.ARG_WAIT, waitTimeArg]);
+ [
+ SliderActions.ACTION_FREEZE, clustername,
+ Arguments.ARG_WAIT, waitTimeArg
+ ]);
assertSucceeded(freezeCommand)
log.info("Second Freeze command");
- ServiceLauncher freeze2 = execSliderCommand(conf,
- [
- SliderActions.ACTION_FREEZE, clustername,
- Arguments.ARG_WAIT, waitTimeArg
- ]);
+ ServiceLauncher<SliderClient> freeze2 = execSliderCommand(conf,
+ [
+ SliderActions.ACTION_FREEZE, clustername,
+ Arguments.ARG_WAIT, waitTimeArg
+ ]);
assertSucceeded(freeze2)
log.info("First Exists");
//assert there is no running cluster
try {
- ServiceLauncher exists1 = launchClientAgainstMiniMR(
+ ServiceLauncher<SliderClient> exists1 = launchClientAgainstMiniMR(
//config includes RM binding info
new YarnConfiguration(miniCluster.config),
[
@@ -82,7 +89,7 @@
Arguments.ARG_FILESYSTEM, fsDefaultName,
Arguments.ARG_LIVE
],
- )
+ )
assert 0 != exists1.serviceExitCode;
} catch (SliderException e) {
assert e.exitCode == LauncherExitCodes.EXIT_FALSE;
@@ -97,36 +104,36 @@
Arguments.ARG_FILESYSTEM, fsDefaultName
]
commands.addAll(extraCLIArgs)
-
+
ServiceLauncher thawCommand = execSliderCommand(conf, commands);
assertSucceeded(thawCommand)
assertSucceeded(execSliderCommand(conf,
- [SliderActions.ACTION_LIST, clustername]))
+ [SliderActions.ACTION_LIST, clustername]))
assertSucceeded(execSliderCommand(conf,
- [SliderActions.ACTION_EXISTS, clustername]))
+ [SliderActions.ACTION_EXISTS, clustername]))
log.info("Freeze 3");
- ServiceLauncher freeze3 = execSliderCommand(conf,
- [
- SliderActions.ACTION_FREEZE, clustername,
- Arguments.ARG_WAIT, waitTimeArg
- ]);
+ ServiceLauncher<SliderClient> freeze3 = execSliderCommand(conf,
+ [
+ SliderActions.ACTION_FREEZE, clustername,
+ Arguments.ARG_WAIT, waitTimeArg
+ ]);
assertSucceeded(freeze3)
log.info("thaw2");
- ServiceLauncher thaw2 = execSliderCommand(conf,
+ ServiceLauncher<SliderClient> thaw2 = execSliderCommand(conf,
commands);
assert 0 == thaw2.serviceExitCode;
assertSucceeded(thaw2)
try {
log.info("thaw3 - should fail");
- ServiceLauncher thaw3 = execSliderCommand(conf,
+ ServiceLauncher<SliderClient> thaw3 = execSliderCommand(conf,
commands);
assert 0 != thaw3.serviceExitCode;
} catch (SliderException e) {
- assertFailureClusterInUse(e);
+ YarnMiniClusterTestBase.assertFailureClusterInUse(e);
}
//destroy should fail
@@ -134,7 +141,7 @@
log.info("destroy1");
try {
- ServiceLauncher destroy1 = execSliderCommand(conf,
+ ServiceLauncher<SliderClient> destroy1 = execSliderCommand(conf,
[
SliderActions.ACTION_DESTROY, clustername,
Arguments.ARG_FILESYSTEM, fsDefaultName
@@ -145,24 +152,24 @@
assertFailureClusterInUse(e);
}
log.info("freeze4");
-
- //kill -19 the process to hang it, then force kill
- killAM(SIGSTOP)
- ServiceLauncher freeze4 = execSliderCommand(conf,
- [
- SliderActions.ACTION_FREEZE, clustername,
- Arguments.ARG_FORCE,
- Arguments.ARG_WAIT, waitTimeArg,
- ]);
+ //kill -19 the process to hang it, then force kill
+ killAM(YarnMiniClusterTestBase.SIGSTOP)
+
+ ServiceLauncher<SliderClient> freeze4 = execSliderCommand(conf,
+ [
+ SliderActions.ACTION_FREEZE, clustername,
+ Arguments.ARG_FORCE,
+ Arguments.ARG_WAIT, waitTimeArg,
+ ]);
assertSucceeded(freeze4)
log.info("destroy2");
- ServiceLauncher destroy2 = execSliderCommand(conf,
- [
- SliderActions.ACTION_DESTROY, clustername,
- Arguments.ARG_FILESYSTEM, fsDefaultName,
- ]);
+ ServiceLauncher<SliderClient> destroy2 = execSliderCommand(conf,
+ [
+ SliderActions.ACTION_DESTROY, clustername,
+ Arguments.ARG_FILESYSTEM, fsDefaultName,
+ ]);
assertSucceeded(destroy2)
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeThawMasterlessAM.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestFreezeThawMasterlessAM.groovy
similarity index 77%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeThawMasterlessAM.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestFreezeThawMasterlessAM.groovy
index 827fd5e..e833423 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeThawMasterlessAM.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestFreezeThawMasterlessAM.groovy
@@ -16,27 +16,26 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.minicluster.freezethaw
+package org.apache.slider.agent.freezethaw
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.apache.hadoop.fs.FileSystem as HadoopFS
import org.apache.hadoop.fs.Path
-import org.apache.slider.common.tools.SliderUtils
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.tools.SliderUtils
import org.apache.slider.core.main.ServiceLauncher
import org.junit.Test
/**
- * create masterless AMs and work with them. This is faster than
- * bringing up full clusters
+ * freeze and thaw an AM
*/
@CompileStatic
@Slf4j
-class TestFreezeThawMasterlessAM extends HBaseMiniClusterTestBase {
+class TestFreezeThawMasterlessAM extends AgentMiniClusterTestBase {
File getConfDirFile() {
return new File("target/TestFreezeThawMasterlessAM/conf")
@@ -50,18 +49,18 @@
@Test
public void testFreezeThawMasterlessAM() throws Throwable {
String clustername = "test_freeze_thaw_masterless_am"
- YarnConfiguration conf = getConfiguration()
- createMiniCluster(clustername, conf, 1, 1, 1, true, true)
+ YarnConfiguration conf = configuration
+ createMiniCluster(clustername, conf, 1, 1, 1, true, false)
describe "create a masterless AM, freeze it, thaw it"
//copy the confdir somewhere
- Path resConfPath = new Path(getResourceConfDirURI())
+ Path resConfPath = new Path(resourceConfDirURI)
Path tempConfPath = new Path(confDir)
SliderUtils.copyDirectory(conf, resConfPath, tempConfPath, null)
- ServiceLauncher launcher = createMasterlessAM(clustername, 0, true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ ServiceLauncher<SliderClient> launcher = createMasterlessAM(clustername, 0, true, true)
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
assert 0 == clusterActionFreeze(sliderClient, clustername)
@@ -74,7 +73,7 @@
//now start the cluster
ServiceLauncher launcher2 = thawCluster(clustername, [], true);
- SliderClient newCluster = launcher.getService() as SliderClient
+ SliderClient newCluster = launcher2.service
newCluster.getClusterDescription(clustername);
//freeze
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeUnknownCluster.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestFreezeUnknownCluster.groovy
similarity index 83%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeUnknownCluster.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestFreezeUnknownCluster.groovy
index 04c1a6e..ebec43b 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeUnknownCluster.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestFreezeUnknownCluster.groovy
@@ -16,14 +16,15 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.minicluster.freezethaw
+package org.apache.slider.agent.freezethaw
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
-import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
-import org.apache.slider.common.params.SliderActions
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
import org.apache.slider.core.main.ServiceLauncher
import org.junit.Test
@@ -34,19 +35,18 @@
@CompileStatic
@Slf4j
-class TestFreezeUnknownCluster extends HBaseMiniClusterTestBase {
+class TestFreezeUnknownCluster extends AgentMiniClusterTestBase {
@Test
public void testFreezeUnknownCluster() throws Throwable {
String clustername = "test_start_unknown_cluster"
- YarnConfiguration conf = getConfiguration()
+ YarnConfiguration conf = configuration
createMiniCluster(clustername, conf, 1, true)
describe "try to freeze a cluster that isn't defined"
- //we are secretly picking up the RM details from the configuration file
try {
- ServiceLauncher command = execSliderCommand(conf,
+ ServiceLauncher<SliderClient> command = execSliderCommand(conf,
[
SliderActions.ACTION_FREEZE,
"no-such-cluster"
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestThawUnknownCluster.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestThawUnknownCluster.groovy
similarity index 87%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestThawUnknownCluster.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestThawUnknownCluster.groovy
index 9041e48..4c90445 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestThawUnknownCluster.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/freezethaw/TestThawUnknownCluster.groovy
@@ -16,13 +16,14 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.minicluster.freezethaw
+package org.apache.slider.agent.freezethaw
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
+import org.apache.slider.client.SliderClient
import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
-import org.apache.slider.test.YarnZKMiniClusterTestBase
import org.apache.slider.core.main.ServiceLauncher
+import org.apache.slider.test.YarnZKMiniClusterTestBase
import org.junit.Test
/**
@@ -37,12 +38,12 @@
@Test
public void testThawUnknownCluster() throws Throwable {
String clustername = "test_thaw_unknown_cluster"
- createMiniCluster(clustername, getConfiguration(), 1, true)
+ createMiniCluster(clustername, configuration, 1, true)
describe "try to start a cluster that isn't defined"
try {
- ServiceLauncher launcher = thawCluster(clustername, [], true);
+ ServiceLauncher<SliderClient> launcher = thawCluster(clustername, [], true);
fail("expected a failure, got ${launcher.serviceExitCode}")
} catch (UnknownApplicationInstanceException e) {
assert e.toString().contains(clustername)
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestBadAMHeap.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestBadAMHeap.groovy
new file mode 100644
index 0000000..160420b
--- /dev/null
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestBadAMHeap.groovy
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.slider.agent.standalone
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.hadoop.yarn.api.records.ApplicationReport
+import org.apache.hadoop.yarn.api.records.YarnApplicationState
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.api.RoleKeys
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.SliderKeys
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.core.main.ServiceLaunchException
+import org.apache.slider.core.main.ServiceLauncher
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+
+class TestBadAMHeap extends AgentMiniClusterTestBase {
+
+ @Test
+ public void testBadAMHeap() throws Throwable {
+ String clustername = "test_bad_am_heap"
+ createMiniCluster(clustername, configuration, 1, true)
+
+ describe "verify that bad Java heap options are picked up"
+
+ try {
+ ServiceLauncher<SliderClient> launcher =
+ createMasterlessAMWithArgs(clustername,
+ [
+ Arguments.ARG_COMP_OPT,
+ SliderKeys.COMPONENT_AM,
+ RoleKeys.JVM_HEAP, "invalid",
+ ],
+ true,
+ false)
+ SliderClient sliderClient = launcher.service
+ addToTeardown(sliderClient);
+
+ ApplicationReport report = waitForClusterLive(sliderClient)
+ assert report.yarnApplicationState == YarnApplicationState.FAILED
+
+ } catch (ServiceLaunchException e) {
+ assertExceptionDetails(e, SliderExitCodes.EXIT_YARN_SERVICE_FAILED)
+ }
+
+ }
+
+}
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestBadYarnQueue.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestBadYarnQueue.groovy
new file mode 100644
index 0000000..5509314
--- /dev/null
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestBadYarnQueue.groovy
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.slider.agent.standalone
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.hadoop.yarn.api.records.ApplicationReport
+import org.apache.hadoop.yarn.api.records.YarnApplicationState
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.SliderXmlConfKeys
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.core.main.ServiceLaunchException
+import org.apache.slider.core.main.ServiceLauncher
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+
+class TestBadYarnQueue extends AgentMiniClusterTestBase {
+
+ /**
+ * Test disabled because YARN queues don't get validated in the mini cluster
+ * @throws Throwable
+ */
+
+ @Test
+ public void testBadYarnQueue() throws Throwable {
+ skip("untestable in minicluster")
+ String clustername = "test_bad_yarn_queue"
+ createMiniCluster(clustername, configuration, 1, true)
+
+ describe "verify that a bad yarn queue fails the launch"
+
+ try {
+ ServiceLauncher<SliderClient> launcher =
+ createMasterlessAMWithArgs(clustername,
+ [
+ Arguments.ARG_DEFINE,
+ SliderXmlConfKeys.KEY_YARN_QUEUE + "=noqueue",
+
+ ],
+ true,
+ false)
+
+ SliderClient sliderClient = launcher.service
+ addToTeardown(sliderClient);
+
+ ApplicationReport report = waitForClusterLive(sliderClient)
+ assert report.yarnApplicationState == YarnApplicationState.FAILED
+
+ } catch (ServiceLaunchException e) {
+ assertExceptionDetails(e, SliderExitCodes.EXIT_YARN_SERVICE_FAILED)
+ }
+
+ }
+
+}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/build/TestBuildClusterM1W5.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestBuildStandaloneAM.groovy
similarity index 66%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/build/TestBuildClusterM1W5.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestBuildStandaloneAM.groovy
index 80178b1..2933c90 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/build/TestBuildClusterM1W5.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestBuildStandaloneAM.groovy
@@ -16,50 +16,41 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.minicluster.build
+package org.apache.slider.agent.standalone
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
-import org.apache.slider.core.main.LauncherExitCodes
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.core.exceptions.SliderException
-import org.apache.slider.providers.hbase.HBaseKeys
-import org.apache.slider.common.params.SliderActions
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
import org.apache.hadoop.yarn.api.records.ApplicationReport
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.core.exceptions.SliderException
+import org.apache.slider.core.main.LauncherExitCodes
import org.apache.slider.core.main.ServiceLauncher
import org.junit.Test
-import static HBaseKeys.PROVIDER_HBASE
-import static org.apache.slider.common.params.Arguments.ARG_PROVIDER
-
@CompileStatic
@Slf4j
-class TestBuildClusterM1W5 extends HBaseMiniClusterTestBase {
+class TestBuildStandaloneAM extends AgentMiniClusterTestBase {
@Test
public void testBuildCluster() throws Throwable {
- String clustername = "test_build_cluster_m1_w5"
- createMiniCluster(clustername, getConfiguration(), 1, true)
+ String clustername = "test_build_cluster"
+ createMiniCluster(clustername, configuration, 1, true)
describe "verify that a build cluster is created but not started"
- ServiceLauncher launcher = createOrBuildCluster(
+ ServiceLauncher<SliderClient> launcher = createOrBuildCluster(
SliderActions.ACTION_BUILD,
clustername,
- [
- (HBaseKeys.ROLE_MASTER): 1,
- (HBaseKeys.ROLE_WORKER): 5,
- ],
- [
- ARG_PROVIDER, PROVIDER_HBASE
- ],
+ [:],
+ [],
true,
false,
- [:])
- SliderClient sliderClient = (SliderClient) launcher.service
+ agentDefOptions)
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
//verify that exists(live) is now false
@@ -75,22 +66,24 @@
//and a second attempt will fail as the cluster now exists
try {
- createOrBuildCluster(
+ ServiceLauncher<SliderClient> cluster2 = createOrBuildCluster(
SliderActions.ACTION_BUILD,
clustername,
- [
- (HBaseKeys.ROLE_MASTER): 1,
- (HBaseKeys.ROLE_WORKER): 3,
- ],
- [
- ARG_PROVIDER, PROVIDER_HBASE
- ],
- true,
+ [:],
+ [],
false,
- [:])
+ false,
+ agentDefOptions)
+ fail("expected an exception, got $cluster2.service")
} catch (SliderException e) {
- assert e.exitCode == SliderExitCodes.EXIT_INSTANCE_EXISTS
+ assertExceptionDetails(e, SliderExitCodes.EXIT_INSTANCE_EXISTS, "")
}
+
+ //thaw time
+ ServiceLauncher<SliderClient> l2 = thawCluster(clustername, [], true)
+ SliderClient thawed = l2.service
+ addToTeardown(thawed);
+ waitForClusterLive(thawed)
}
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestDestroyMasterlessAM.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestDestroyMasterlessAM.groovy
similarity index 77%
rename from slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestDestroyMasterlessAM.groovy
rename to slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestDestroyMasterlessAM.groovy
index bf9addc..37fa0ec 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestDestroyMasterlessAM.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestDestroyMasterlessAM.groovy
@@ -16,43 +16,43 @@
* limitations under the License.
*/
-package org.apache.slider.providers.hbase.minicluster.masterless
+package org.apache.slider.agent.standalone
+import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.client.SliderClient
import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.params.ActionEchoArgs
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.common.tools.SliderFileSystem
import org.apache.slider.core.exceptions.ErrorStrings
import org.apache.slider.core.exceptions.SliderException
import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
-import org.apache.slider.common.tools.SliderFileSystem
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.ActionEchoArgs
-import org.apache.slider.common.params.CommonArgs
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
import org.apache.slider.core.main.ServiceLauncher
import org.junit.Test
/**
- * create masterless AMs and work with them. This is faster than
- * bringing up full clusters
+ * destroy a masterless AM
*/
-//@CompileStatic
+@CompileStatic
@Slf4j
-class TestDestroyMasterlessAM extends HBaseMiniClusterTestBase {
+class TestDestroyMasterlessAM extends AgentMiniClusterTestBase {
@Test
public void testDestroyMasterlessAM() throws Throwable {
String clustername = "test_destroy_masterless_am"
- createMiniCluster(clustername, getConfiguration(), 1, true)
+ createMiniCluster(clustername, configuration, 1, false)
describe "create a masterless AM, stop it, try to create" +
"a second cluster with the same name, destroy it, try a third time"
- ServiceLauncher launcher1 = launchClientAgainstMiniMR(
- getConfiguration(),
+ ServiceLauncher<SliderClient> launcher1 = launchClientAgainstMiniMR(
+ configuration,
[
- CommonArgs.ACTION_DESTROY,
+ SliderActions.ACTION_DESTROY,
"no-cluster-of-this-name",
Arguments.ARG_FILESYSTEM, fsDefaultName,
])
@@ -60,16 +60,16 @@
- ServiceLauncher launcher = createMasterlessAM(clustername, 0, true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ ServiceLauncher<SliderClient> launcher = createMasterlessAM(clustername, 0, true, true)
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
SliderFileSystem sliderFileSystem = createSliderFileSystem()
- def hdfs = sliderFileSystem.fileSystem
+ def fs = sliderFileSystem.fileSystem
def instanceDir = sliderFileSystem.buildClusterDirPath(clustername)
assertPathExists(
- hdfs,
+ fs,
"cluster path not found",
instanceDir)
@@ -104,19 +104,16 @@
describe "thaw expected to fail"
//expect thaw to now fail
- try {
- launcher = launch(SliderClient,
- configuration,
- [
- CommonArgs.ACTION_THAW,
- clustername,
- Arguments.ARG_FILESYSTEM, fsDefaultName,
- Arguments.ARG_MANAGER, RMAddr,
- ])
- fail("expected an exception")
- } catch (UnknownApplicationInstanceException e) {
- //expected
- }
+ def ex = launchExpectingException(SliderClient,
+ configuration,
+ "",
+ [
+ SliderActions.ACTION_THAW,
+ clustername,
+ Arguments.ARG_FILESYSTEM, fsDefaultName,
+ Arguments.ARG_MANAGER, RMAddr,
+ ])
+ assert ex instanceof UnknownApplicationInstanceException
describe "thaw completed, checking dir is still absent"
sliderFileSystem.verifyDirectoryNonexistent(instanceDir)
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestKillMasterlessAM.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestKillMasterlessAM.groovy
new file mode 100644
index 0000000..b4331af
--- /dev/null
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestKillMasterlessAM.groovy
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.slider.agent.standalone
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.hadoop.yarn.api.records.ApplicationReport
+import org.apache.hadoop.yarn.api.records.YarnApplicationState
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.SliderXmlConfKeys
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.core.main.ServiceLauncher
+import org.junit.Test
+
+/**
+ * kill a masterless AM and verify it shuts down. This test
+ * also sets the retry count to 1 to stop recreation attempts
+ */
+@CompileStatic
+@Slf4j
+
+class TestKillMasterlessAM extends AgentMiniClusterTestBase {
+
+
+ @Test
+ public void testKillMasterlessAM() throws Throwable {
+ String clustername = "test_kill_masterless_am"
+ createMiniCluster(clustername, configuration, 1, true)
+
+ describe "kill a masterless AM and verify that it shuts down"
+ ServiceLauncher<SliderClient> launcher =
+ createMasterlessAMWithArgs(clustername,
+ [
+ Arguments.ARG_OPTION, SliderXmlConfKeys.KEY_AM_RESTART_LIMIT, "1"
+ ],
+ true,
+ false)
+ SliderClient sliderClient = launcher.service
+ addToTeardown(sliderClient);
+ ApplicationReport report = waitForClusterLive(sliderClient)
+
+ describe("listing Java processes")
+ lsJavaProcesses();
+ describe("killing AM")
+ killAM(SIGTERM);
+ waitWhileClusterLive(sliderClient);
+ //give yarn some time to notice
+ sleep(10000)
+ describe("final listing")
+ lsJavaProcesses();
+ report = sliderClient.applicationReport
+ assert YarnApplicationState.FAILED == report.yarnApplicationState;
+ clusterActionFreeze(sliderClient, clustername)
+ }
+
+
+}
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy
index fee3b99..ab0c855 100644
--- a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy
@@ -31,7 +31,6 @@
import org.apache.slider.core.main.ServiceLauncher
import org.apache.slider.core.registry.info.ServiceInstanceData
import org.apache.slider.server.services.curator.CuratorServiceInstance
-import org.apache.slider.server.services.curator.RegistryBinderService
import org.apache.slider.server.services.registry.SliderRegistryService
import org.junit.Test
@@ -47,8 +46,8 @@
//launch fake master
String clustername = "test_standalone_agent_am"
createMiniCluster(clustername, configuration, 1, true)
- ServiceLauncher<SliderClient> launcher
- launcher = createMasterlessAM(clustername, 0, true, false)
+ ServiceLauncher<SliderClient> launcher =
+ createMasterlessAM(clustername, 0, true, false)
SliderClient client = launcher.service
addToTeardown(client);
@@ -139,8 +138,6 @@
clustername)
assert i2AppID == instance2.applicationId
-
-
describe("attempting to create instance #3")
//now try to create instance #3, and expect an in-use failure
try {
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneBadClusterName.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneBadClusterName.groovy
new file mode 100644
index 0000000..b2cb670
--- /dev/null
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneBadClusterName.groovy
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.slider.agent.standalone
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.agent.AgentMiniClusterTestBase
+import org.apache.slider.core.main.LauncherExitCodes
+import org.apache.slider.core.main.ServiceLaunchException
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+
+class TestStandaloneBadClusterName extends AgentMiniClusterTestBase {
+
+ @Test
+ public void testStandaloneBadClusterName() throws Throwable {
+ String clustername = "TestStandaloneBadClusterName"
+ createMiniCluster(clustername, configuration, 1, true)
+
+ describe "verify that bad cluster names are picked up"
+
+ try {
+ addToTeardown(createMasterlessAM(clustername, 0, true, false).service);
+ fail("expected a failure")
+ } catch (ServiceLaunchException e) {
+ assertExceptionDetails(e, LauncherExitCodes.EXIT_COMMAND_ARGUMENT_ERROR)
+ }
+
+ }
+
+}
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy
index cd82aa0..fb39cad 100644
--- a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneRegistryAM.groovy
@@ -38,7 +38,6 @@
import org.apache.slider.server.appmaster.PublishedArtifacts
import org.apache.slider.server.appmaster.web.rest.RestPaths
import org.apache.slider.server.services.curator.CuratorServiceInstance
-import org.apache.slider.server.services.curator.RegistryBinderService
import org.apache.slider.server.services.registry.SliderRegistryService
import org.junit.Test
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
index 9ccae32..a784a0a 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
@@ -483,21 +483,22 @@
return serviceLauncher;
}
- public static void launchExpectingException(Class serviceClass,
+ public static Throwable launchExpectingException(Class serviceClass,
Configuration conf,
String expectedText,
List args)
throws Throwable {
try {
ServiceLauncher launch = launch(serviceClass, conf, args);
- fail("Expected an exception with text containing " + expectedText
+ throw new AssertionError("Expected an exception with text containing " + expectedText
+ " -but the service completed with exit code "
+ launch.serviceExitCode);
} catch (Throwable thrown) {
- if (!thrown.toString().contains(expectedText)) {
+ if (expectedText && !thrown.toString().contains(expectedText)) {
//not the right exception -rethrow
throw thrown;
}
+ return thrown;
}
}
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
index b1111b2..fe1ffc1 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
@@ -331,10 +331,7 @@
}
- public void killServiceLaunchers(int value) {
- killAM(value)
- }
-
+
public YarnConfiguration getTestConfiguration() {
YarnConfiguration conf = getConfiguration()
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/HBaseMiniClusterTestBase.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/HBaseMiniClusterTestBase.groovy
index 4fcdc65..3f49771 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/HBaseMiniClusterTestBase.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/HBaseMiniClusterTestBase.groovy
@@ -64,7 +64,7 @@
@Override
void setup() {
super.setup()
- def testConf = getTestConfiguration()
+ def testConf = testConfiguration
assumeBoolOption(testConf, KEY_TEST_HBASE_ENABLED, true)
assumeArchiveDefined();
assumeApplicationHome();
@@ -280,7 +280,7 @@
int workers,
int flexTarget,
boolean testHBaseAfter) {
- createMiniCluster(clustername, getConfiguration(),
+ createMiniCluster(clustername, configuration,
1,
true);
//now launch the cluster
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/archives/TestFreezeThawClusterFromArchive.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/archives/TestFreezeThawClusterFromArchive.groovy
index 307a730..c9e0b24 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/archives/TestFreezeThawClusterFromArchive.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/archives/TestFreezeThawClusterFromArchive.groovy
@@ -57,7 +57,7 @@
killAllRegionServers();
//now let's start the cluster up again
- ServiceLauncher launcher2 = thawCluster(clustername, [], true);
+ ServiceLauncher<SliderClient> launcher2 = thawCluster(clustername, [], true);
SliderClient newCluster = launcher2.service
basicHBaseClusterStartupSequence(newCluster)
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/archives/TestLiveClusterFromArchive.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/archives/TestLiveClusterFromArchive.groovy
index 29c9033..e5bfb66 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/archives/TestLiveClusterFromArchive.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/archives/TestLiveClusterFromArchive.groovy
@@ -37,16 +37,21 @@
@Test
public void testLiveClusterFromArchive() throws Throwable {
- String clustername = getTestClusterName()
+ String clustername = testClusterName
int regionServerCount = 1
- createMiniCluster(clustername, getConfiguration(), regionServerCount + 1, 1, 1, true,
- startHDFS())
+ createMiniCluster(clustername,
+ configuration,
+ regionServerCount + 1,
+ 1,
+ 1,
+ true,
+ startHDFS())
//now launch the cluster
setupImageToDeploy()
- ServiceLauncher launcher = createHBaseCluster(clustername, regionServerCount, [], true, true)
+ ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, regionServerCount, [], true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ SliderClient sliderClient = launcher.service
ClusterStatus clustat = basicHBaseClusterStartupSequence(sliderClient)
//get the hbase status
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/build/TestBuildThawClusterM1W1.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/build/TestBuildThawClusterM1W1.groovy
index d1ef2d8..a2af619 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/build/TestBuildThawClusterM1W1.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/build/TestBuildThawClusterM1W1.groovy
@@ -39,11 +39,11 @@
@Test
public void test_build_thaw_cluster_m1_w1() throws Throwable {
String clustername = "test_build_thaw_cluster_m1_w1"
- createMiniCluster(clustername, getConfiguration(), 1, true)
+ createMiniCluster(clustername, configuration, 1, true)
describe "verify that a built cluster can be thawed"
- ServiceLauncher launcher = createOrBuildCluster(
+ ServiceLauncher<SliderClient> launcher = createOrBuildCluster(
SliderActions.ACTION_BUILD,
clustername,
[
@@ -56,17 +56,17 @@
true,
false,
[:])
- SliderClient sliderClient = (SliderClient) launcher.service
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
def serviceRegistryClient = sliderClient.YARNRegistryClient
ApplicationReport report = serviceRegistryClient.findInstance(clustername)
assert report == null;
//thaw time
- ServiceLauncher l2 = thawCluster(clustername, [], true)
- SliderClient client2 = (SliderClient) l2.service
- addToTeardown(client2);
- waitForClusterLive(l2.service as SliderClient)
+ ServiceLauncher<SliderClient> l2 = thawCluster(clustername, [], true)
+ SliderClient thawed = l2.service
+ addToTeardown(thawed);
+ waitForClusterLive(thawed)
}
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestFailedRegionService.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestFailedRegionService.groovy
index 1c8d3d2..16cdef6 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestFailedRegionService.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestFailedRegionService.groovy
@@ -51,12 +51,12 @@
String clustername = testName
String action = toKill ? "kill" : "stop"
int regionServerCount = 2
- createMiniCluster(clustername, getConfiguration(), 1, 1, 1, true, true)
+ createMiniCluster(clustername, configuration, 1, 1, 1, true, true)
describe("Create a single region service cluster then " + action + " the RS");
//now launch the cluster
- ServiceLauncher launcher = createHBaseCluster(clustername, regionServerCount, [], true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, regionServerCount, [], true, true)
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
ClusterDescription status = sliderClient.getClusterDescription(clustername)
@@ -90,7 +90,7 @@
hbaseStat = waitForHBaseRegionServerCount(sliderClient, clustername, regionServerCount, hbaseClusterStartupToLiveTime)
- status = sliderClient.getClusterDescription()
+ status = sliderClient.clusterDescription
assert status.roles[HBaseKeys.ROLE_WORKER][RoleKeys.ROLE_FAILED_INSTANCES] == "2"
log.info("Updated cluster status : ${hbaseStatusToString(hbaseStat)}");
@@ -107,7 +107,7 @@
sliderClient,
regionServerCount,
hbaseClusterStartupToLiveTime)
- status = sliderClient.getClusterDescription()
+ status = sliderClient.clusterDescription
assert status.roles[HBaseKeys.ROLE_WORKER][RoleKeys.ROLE_FAILED_INSTANCES] == "3"
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestFailureThreshold.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestFailureThreshold.groovy
index ef073bc..e43ad81 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestFailureThreshold.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestFailureThreshold.groovy
@@ -68,7 +68,8 @@
regionServerCount,
[
Arguments.ARG_OPTION, OptionKeys.INTERNAL_CONTAINER_FAILURE_THRESHOLD,
- Integer.toString(threshold)],
+ Integer.toString(threshold)
+ ],
true,
true)
SliderClient client = launcher.service
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestKilledHBaseMaster.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestKilledHBaseMaster.groovy
index d05855f..35ed129 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestKilledHBaseMaster.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/failures/TestKilledHBaseMaster.groovy
@@ -42,12 +42,12 @@
public void testKilledHBaseMaster() throws Throwable {
String clustername = "test_killed_hbase_master"
int regionServerCount = 1
- createMiniCluster(clustername, getConfiguration(), 1, 1, 1, true, true)
+ createMiniCluster(clustername, configuration, 1, 1, 1, true, true)
describe("Kill the hbase master and expect a restart");
//now launch the cluster
- ServiceLauncher launcher = createHBaseCluster(clustername, regionServerCount, [], true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, regionServerCount, [], true, true)
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
ClusterDescription status = sliderClient.getClusterDescription(clustername)
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex1To1.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex1To1.groovy
index 3e0319f..ba1bb94 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex1To1.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex1To1.groovy
@@ -38,8 +38,7 @@
1,
1,
1,
- 1
- ,
+ 1,
true)
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex1To2.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex1To2.groovy
index 0df1c77..fd8e1ae 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex1To2.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex1To2.groovy
@@ -37,8 +37,7 @@
1,
1,
1,
- 2
- ,
+ 2,
true)
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex2DownTo1.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex2DownTo1.groovy
index 7596827..c76a9d3 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex2DownTo1.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex2DownTo1.groovy
@@ -37,8 +37,7 @@
"test_cluster_flex_2_down_to_1",
1, 1,
2,
- 1
- ,
+ 1,
false)
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex2To5.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex2To5.groovy
index 1fc41f6..39c1cac 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex2To5.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlex2To5.groovy
@@ -37,8 +37,7 @@
1,
1,
2,
- 5
- ,
+ 5,
true)
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlexDownToZero.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlexDownToZero.groovy
index 12ad6a7..5b392e8 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlexDownToZero.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestClusterFlexDownToZero.groovy
@@ -34,10 +34,10 @@
public void testClusterFlexDownToZero() throws Throwable {
assert flexHBaseClusterTestRun(
"test_cluster_flex_down_to_zero",
- 1, 1,
1,
- 0
- ,
+ 1,
+ 1,
+ 0,
false)
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestHMasterFlex1To2.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestHMasterFlex1To2.groovy
index 1eae82e..0910c6e 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestHMasterFlex1To2.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/flexing/TestHMasterFlex1To2.groovy
@@ -37,8 +37,7 @@
1,
2,
1,
- 1
- ,
+ 1,
true)
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeReconfigureThawLiveRegionService.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeReconfigureThawLiveRegionService.groovy
index 7264944..62e4d4b 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeReconfigureThawLiveRegionService.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeReconfigureThawLiveRegionService.groovy
@@ -50,7 +50,7 @@
String clustername = "test_freeze_reconfigure_thaw_live_regionservice"
int regionServerCount = 4
int nodemanagers = 3
- YarnConfiguration conf = getConfiguration()
+ YarnConfiguration conf = configuration
//one vcore per node
conf.setInt("yarn.nodemanager.resource.cpu-vcores", 1)
createMiniCluster(clustername, conf, nodemanagers, true)
@@ -58,13 +58,13 @@
"Create a $regionServerCount node cluster, freeze it, patch the configuration files," +
" thaw it and verify that it came back with the new settings")
- ServiceLauncher launcher = createHBaseCluster(
+ ServiceLauncher<SliderClient> launcher = createHBaseCluster(
clustername,
regionServerCount,
[],
true,
true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
ClusterDescription status = sliderClient.getClusterDescription(clustername)
log.info("${status.toJsonString()}")
@@ -93,7 +93,7 @@
sliderFileSystem,
clusterDir)
- def snapshotPath = instanceDefinition.getInternalOperations().get(
+ def snapshotPath = instanceDefinition.internalOperations.get(
OptionKeys.INTERNAL_SNAPSHOT_CONF_PATH)
assert snapshotPath != null
@@ -110,8 +110,8 @@
ConfigHelper.saveConfig(dfs, hbaseSiteXML, originalConf);
//now let's start the cluster up again
- ServiceLauncher launcher2 = thawCluster(clustername, [], true);
- SliderClient thawed = launcher2.service as SliderClient
+ ServiceLauncher<SliderClient> launcher2 = thawCluster(clustername, [], true);
+ SliderClient thawed = launcher2.service
clustat = basicHBaseClusterStartupSequence(thawed)
//get the options
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeThawLiveRegionService.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeThawLiveRegionService.groovy
index 445e04b..f9d460e 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeThawLiveRegionService.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/freezethaw/TestFreezeThawLiveRegionService.groovy
@@ -43,15 +43,15 @@
public void testFreezeThawLiveRegionService() throws Throwable {
String clustername = "test_freeze_thaw_live_regionservice"
int regionServerCount = 2
- createMiniCluster(clustername, getConfiguration(), 1, true)
+ createMiniCluster(clustername, configuration, 1, true)
describe("Create a cluster, freeze it, thaw it and verify that it came back ")
//use a smaller AM HEAP to include it in the test cycle
ServiceLauncher launcher = createHBaseCluster(clustername, regionServerCount,
- [
- Arguments.ARG_COMP_OPT, SliderKeys.COMPONENT_AM, RoleKeys.JVM_HEAP, "96M",
- ],
- true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ [
+ Arguments.ARG_COMP_OPT, SliderKeys.COMPONENT_AM, RoleKeys.JVM_HEAP, "96M",
+ ],
+ true, true)
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
ClusterDescription status = sliderClient.getClusterDescription(clustername)
log.info("${status.toJsonString()}")
@@ -66,8 +66,8 @@
//verify you can't start a new cluster with that name
try {
- ServiceLauncher launcher3 = createHBaseCluster(clustername, regionServerCount, [], false, false)
- SliderClient cluster3 = launcher3.service as SliderClient
+ ServiceLauncher<SliderClient> launcher3 = createHBaseCluster(clustername, regionServerCount, [], false, false)
+ SliderClient cluster3 = launcher3.service
fail("expected a failure, got ${cluster3}")
} catch (SliderException e) {
assert e.exitCode == SliderExitCodes.EXIT_APPLICATION_IN_USE;
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/Test2Master2RS.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/Test2Master2RS.groovy
index 69a0bbc..c2652b8 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/Test2Master2RS.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/Test2Master2RS.groovy
@@ -43,13 +43,13 @@
String clustername = "test2master2rs"
int regionServerCount = 2
- createMiniCluster(clustername, getConfiguration(), 1, 1, 1, true, false)
+ createMiniCluster(clustername, configuration, 1, 1, 1, true, false)
describe(" Create a two master, two region service cluster");
//now launch the cluster
int masterCount = 2
- ServiceLauncher launcher = createHBaseCluster(
+ ServiceLauncher<SliderClient> launcher = createHBaseCluster(
clustername,
masterCount,
regionServerCount,
@@ -57,7 +57,7 @@
true,
true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
ClusterDescription status = sliderClient.getClusterDescription(clustername)
log.info("${status.toJsonString()}")
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMaster.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMaster.groovy
index 5abd95f..55ff38a 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMaster.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMaster.groovy
@@ -45,19 +45,19 @@
@Test
public void testHBaseMaster() throws Throwable {
String clustername = "test_hbase_master"
- createMiniCluster(clustername, getConfiguration(), 1, true)
+ createMiniCluster(clustername, configuration, 1, true)
//make sure that ZK is up and running at the binding string
ZKIntegration zki = createZKIntegrationInstance(ZKBinding, clustername, false, false, 5000)
//now launch the cluster with 1 region server
int regionServerCount = 1
- ServiceLauncher launcher = createHBaseCluster(clustername, regionServerCount,
+ ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, regionServerCount,
[
Arguments.ARG_COMP_OPT, HBaseKeys.ROLE_MASTER, RoleKeys.JVM_HEAP, "256M",
Arguments.ARG_DEFINE, SliderXmlConfKeys.KEY_YARN_QUEUE + "=default"
],
true,
true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
ClusterDescription status = sliderClient.getClusterDescription(clustername)
@@ -75,38 +75,4 @@
hbaseClusterStartupToLiveTime)
}
- @Test
- public void testHBaseMasterWithBadHeap() throws Throwable {
- String clustername = "test_hbase_master_with_bad_heap"
- createMiniCluster(clustername, getConfiguration(), 1, true)
-
- describe "verify that bad Java heap options are picked up"
- //now launch the cluster with 1 region server
- int regionServerCount = 1
- try {
- ServiceLauncher launcher = createHBaseCluster(clustername, regionServerCount,
- [Arguments.ARG_COMP_OPT, HBaseKeys.ROLE_WORKER, RoleKeys.JVM_HEAP, "invalid"], true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
- addToTeardown(sliderClient);
-
- AggregateConf launchedInstance = sliderClient.launchedInstanceDefinition
- AggregateConf liveInstance = sliderClient.launchedInstanceDefinition
-
-
-
- basicHBaseClusterStartupSequence(sliderClient)
- def report = waitForClusterLive(sliderClient)
-
- ClusterStatus clustat = getHBaseClusterStatus(sliderClient);
- // verify that region server cannot start
- if (clustat.servers.size()) {
- dumpClusterDescription("original",launchedInstance )
- dumpClusterDescription("live", sliderClient.liveInstanceDefinition)
- dumpClusterStatus(sliderClient,"JVM heap option not picked up")
- }
- assert 0 == clustat.servers.size()
- } catch (ServiceLaunchException e) {
- assertExceptionDetails(e, SliderExitCodes.EXIT_DEPLOYMENT_FAILED)
- }
- }
}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterOnHDFS.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterOnHDFS.groovy
index d4f52ff..fffd6c0 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterOnHDFS.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterOnHDFS.groovy
@@ -36,11 +36,11 @@
@Test
public void testHBaseMasteOnHDFS() throws Throwable {
String clustername = "test_hbase_master_on_hdfs"
- createMiniCluster(clustername, getConfiguration(), 1, 1, 1, true, true)
+ createMiniCluster(clustername, configuration, 1, 1, 1, true, true)
log.info("HDFS is at $fsDefaultName")
assert fsDefaultName.startsWith("hdfs://")
- ServiceLauncher launcher = createHBaseCluster(clustername, 1, [], true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, 1, [], true, true)
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
ClusterDescription status = sliderClient.getClusterDescription(clustername)
log.info("Status $status")
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterWithBadHeap.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterWithBadHeap.groovy
new file mode 100644
index 0000000..5515eac
--- /dev/null
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterWithBadHeap.groovy
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.slider.providers.hbase.minicluster.live
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.hadoop.hbase.ClusterStatus
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.api.RoleKeys
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.SliderXmlConfKeys
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.core.conf.AggregateConf
+import org.apache.slider.core.main.ServiceLaunchException
+import org.apache.slider.core.main.ServiceLauncher
+import org.apache.slider.core.registry.zk.ZKIntegration
+import org.apache.slider.providers.hbase.HBaseKeys
+import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
+import org.junit.Test
+
+/**
+ * Create a master against the File:// fs
+ */
+@CompileStatic
+@Slf4j
+class TestHBaseMasterWithBadHeap extends HBaseMiniClusterTestBase {
+
+
+ @Test
+ public void testHBaseMasterWithBadHeap() throws Throwable {
+ String clustername = "test_hbase_master_with_bad_heap"
+ createMiniCluster(clustername, configuration, 1, true)
+
+ describe "verify that bad Java heap options are picked up"
+ //now launch the cluster with 1 region server
+ int regionServerCount = 1
+ try {
+ ServiceLauncher launcher = createHBaseCluster(clustername, regionServerCount,
+ [Arguments.ARG_COMP_OPT, HBaseKeys.ROLE_WORKER, RoleKeys.JVM_HEAP, "invalid"], true, true)
+ SliderClient sliderClient = (SliderClient) launcher.service
+ addToTeardown(sliderClient);
+
+ AggregateConf launchedInstance = sliderClient.launchedInstanceDefinition
+ AggregateConf liveInstance = sliderClient.launchedInstanceDefinition
+
+
+
+ basicHBaseClusterStartupSequence(sliderClient)
+ def report = waitForClusterLive(sliderClient)
+
+ ClusterStatus clustat = getHBaseClusterStatus(sliderClient);
+ // verify that region server cannot start
+ if (clustat.servers.size()) {
+ dumpClusterDescription("original",launchedInstance )
+ dumpClusterDescription("live", sliderClient.liveInstanceDefinition)
+ dumpClusterStatus(sliderClient,"JVM heap option not picked up")
+ }
+ assert 0 == clustat.servers.size()
+ } catch (ServiceLaunchException e) {
+ assertExceptionDetails(e, SliderExitCodes.EXIT_DEPLOYMENT_FAILED)
+ }
+ }
+}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveRegionServiceOnHDFS.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveRegionServiceOnHDFS.groovy
index 2d935d7..eb94580 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveRegionServiceOnHDFS.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveRegionServiceOnHDFS.groovy
@@ -39,14 +39,14 @@
public void testLiveRegionServiceOnHDFS() throws Throwable {
String clustername = "test_live_region_service_on_hdfs"
int regionServerCount = 1
- createMiniCluster(clustername, getConfiguration(), 1, 1, 1, true, true)
+ createMiniCluster(clustername, configuration, 1, 1, 1, true, true)
describe(" Create a single region service cluster");
//make sure that ZK is up and running at the binding string
ZKIntegration zki = createZKIntegrationInstance(ZKBinding, clustername, false, false, 5000)
//now launch the cluster
- ServiceLauncher launcher = createHBaseCluster(clustername, regionServerCount, [], true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
+ ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, regionServerCount, [], true, true)
+ SliderClient sliderClient = launcher.service
addToTeardown(sliderClient);
ClusterDescription status = sliderClient.getClusterDescription(clustername)
log.info("${status.toJsonString()}")
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy
index fad2392..22d2018 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy
@@ -26,7 +26,6 @@
import org.apache.slider.core.main.ServiceLauncher
import org.apache.slider.core.registry.info.ServiceInstanceData
import org.apache.slider.server.services.curator.CuratorServiceInstance
-import org.apache.slider.server.services.curator.RegistryBinderService
import org.apache.slider.server.services.registry.SliderRegistryService
import org.junit.Test
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestBadArguments.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestBadArguments.groovy
deleted file mode 100644
index 2581e03..0000000
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestBadArguments.groovy
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.slider.providers.hbase.minicluster.masterless
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.common.SliderKeys
-import org.apache.slider.common.SliderXmlConfKeys
-import org.apache.slider.api.RoleKeys
-import org.apache.slider.providers.hbase.HBaseKeys
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
-import org.apache.hadoop.yarn.api.records.ApplicationReport
-import org.apache.hadoop.yarn.api.records.YarnApplicationState
-import org.apache.slider.core.main.ServiceLaunchException
-import org.apache.slider.core.main.ServiceLauncher
-import org.junit.Test
-
-import static HBaseKeys.PROVIDER_HBASE
-import static Arguments.ARG_PROVIDER
-
-@CompileStatic
-@Slf4j
-
-class TestBadArguments extends HBaseMiniClusterTestBase {
-
- @Test
- public void testBadAMHeap() throws Throwable {
- String clustername = "test_bad_am_heap"
- createMiniCluster(clustername, getConfiguration(), 1, true)
-
- describe "verify that bad Java heap options are picked up"
-
- try {
- ServiceLauncher launcher = createCluster(clustername,
- [
- (HBaseKeys.ROLE_MASTER): 0,
- (HBaseKeys.ROLE_WORKER): 0,
- ],
- [
- Arguments.ARG_COMP_OPT, SliderKeys.COMPONENT_AM, RoleKeys.JVM_HEAP, "invalid",
- ARG_PROVIDER, PROVIDER_HBASE
- ],
- true,
- false,
- [:])
- SliderClient sliderClient = (SliderClient) launcher.service
- addToTeardown(sliderClient);
-
- ApplicationReport report = waitForClusterLive(sliderClient)
- assert report.yarnApplicationState == YarnApplicationState.FAILED
-
- } catch (ServiceLaunchException e) {
- assertExceptionDetails(e, SliderExitCodes.EXIT_YARN_SERVICE_FAILED)
- }
-
- }
-
- /**
- * Test disabled because YARN queues don't get validated in the mini cluster
- * @throws Throwable
- */
- public void DisabledtestBadYarnQueue() throws Throwable {
- String clustername = "test_bad_yarn_queue"
- createMiniCluster(clustername, getConfiguration(), 1, true)
-
- describe "verify that bad Java heap options are picked up"
-
- try {
- ServiceLauncher launcher = createCluster(clustername,
- [
- (HBaseKeys.ROLE_MASTER): 0,
- (HBaseKeys.ROLE_WORKER): 0,
- ],
- [
- Arguments.ARG_DEFINE,
- SliderXmlConfKeys.KEY_YARN_QUEUE + "=noqueue",
- ARG_PROVIDER, PROVIDER_HBASE
- ],
- true,
- false,
- [:])
- SliderClient sliderClient = (SliderClient) launcher.service
- addToTeardown(sliderClient);
-
- ApplicationReport report = waitForClusterLive(sliderClient)
- assert report.yarnApplicationState == YarnApplicationState.FAILED
-
- } catch (ServiceLaunchException e) {
- assertExceptionDetails(e, SliderExitCodes.EXIT_YARN_SERVICE_FAILED)
- }
-
- }
-
-}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestBadClusterName.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestBadClusterName.groovy
deleted file mode 100644
index 93eb3b9..0000000
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestBadClusterName.groovy
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.slider.providers.hbase.minicluster.masterless
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.providers.hbase.HBaseKeys
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
-import org.apache.slider.core.main.LauncherExitCodes
-import org.apache.slider.core.main.ServiceLaunchException
-import org.apache.slider.core.main.ServiceLauncher
-import org.junit.Test
-
-import static HBaseKeys.PROVIDER_HBASE
-import static org.apache.slider.common.params.Arguments.ARG_PROVIDER
-
-@CompileStatic
-@Slf4j
-
-class TestBadClusterName extends HBaseMiniClusterTestBase {
-
- @Test
- public void testBadClusterName() throws Throwable {
- String clustername = "TestBadClusterName"
- createMiniCluster(clustername, getConfiguration(), 1, true)
-
- describe "verify that bad cluster are picked up"
-
- try {
- ServiceLauncher launcher = createCluster(clustername,
- [
- (HBaseKeys.ROLE_MASTER): 0,
- (HBaseKeys.ROLE_WORKER): 0,
- ],
- [
- ARG_PROVIDER, PROVIDER_HBASE
- ],
- true,
- false,
- [:])
- SliderClient sliderClient = (SliderClient) launcher.service
- addToTeardown(sliderClient);
- fail("expected a failure")
- } catch (ServiceLaunchException e) {
- assertExceptionDetails(e, LauncherExitCodes.EXIT_COMMAND_ARGUMENT_ERROR)
- }
-
- }
-
-}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestCreateDuplicateLiveCluster.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestCreateDuplicateLiveCluster.groovy
deleted file mode 100644
index da501ee..0000000
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestCreateDuplicateLiveCluster.groovy
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.slider.providers.hbase.minicluster.masterless
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.core.exceptions.SliderException
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
-import org.apache.slider.core.main.ServiceLauncher
-import org.junit.Test
-
-/**
- * create masterless AMs and work with them. This is faster than
- * bringing up full clusters
- */
-@CompileStatic
-@Slf4j
-
-class TestCreateDuplicateLiveCluster extends HBaseMiniClusterTestBase {
-
- @Test
- public void testCreateClusterRunning() throws Throwable {
- String clustername = "test_create_duplicate_live_cluster"
- createMiniCluster(clustername, getConfiguration(), 1, true)
-
- describe "create a masterless AM, while it is running, try to create" +
- "a second cluster with the same name"
-
- //launch fake master
- ServiceLauncher launcher
- launcher = createMasterlessAM(clustername, 0, true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
- addToTeardown(sliderClient);
-
- //now try to create instance #2, and expect an in-use failure
- try {
- createMasterlessAM(clustername, 0, false, true)
- fail("expected a failure")
- } catch (SliderException e) {
- assertFailureClusterInUse(e);
- }
-
-
- }
-
-
-}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestKillMasterlessAM.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestKillMasterlessAM.groovy
deleted file mode 100644
index fd06695..0000000
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestKillMasterlessAM.groovy
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.slider.providers.hbase.minicluster.masterless
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.providers.hbase.HBaseKeys
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
-import org.apache.hadoop.yarn.api.records.ApplicationReport
-import org.apache.hadoop.yarn.api.records.YarnApplicationState
-import org.apache.slider.core.main.ServiceLauncher
-import org.junit.Test
-
-import static org.apache.slider.providers.hbase.HBaseKeys.PROVIDER_HBASE
-import static org.apache.slider.common.params.Arguments.*
-
-/**
- * create masterless AMs and work with them. This is faster than
- * bringing up full clusters
- */
-@CompileStatic
-@Slf4j
-
-class TestKillMasterlessAM extends HBaseMiniClusterTestBase {
-
-
- @Test
- public void testKillMasterlessAM() throws Throwable {
- String clustername = "test_kill_masterless_am"
- createMiniCluster(clustername, getConfiguration(), 1, true)
-
- describe "kill a masterless AM and verify that it shuts down"
-
- Map<String, Integer> roles = [
- (HBaseKeys.ROLE_MASTER): 0,
- (HBaseKeys.ROLE_WORKER): 0,
- ]
- ServiceLauncher launcher = createCluster(clustername,
- roles,
- [
-/*
- ARG_COMP_OPT, SliderKeys.COMPONENT_AM,
- RoleKeys.JVM_OPTS, "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005",
-*/
- ARG_PROVIDER, PROVIDER_HBASE
- ],
- true,
- true,
- [:])
- SliderClient sliderClient = (SliderClient) launcher.service
- addToTeardown(sliderClient);
- describe("listing services")
- lsJavaProcesses();
- describe("killing services")
- killServiceLaunchers(SIGTERM);
- waitWhileClusterLive(sliderClient);
- //give yarn some time to notice
- sleep(2000)
- describe("final listing")
- lsJavaProcesses();
- ApplicationReport report = sliderClient.applicationReport
- assert report.yarnApplicationState == YarnApplicationState.FAILED;
-
-
-
- clusterActionFreeze(sliderClient, clustername)
- }
-
-
-}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestRecreateMasterlessAM.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestRecreateMasterlessAM.groovy
deleted file mode 100644
index 87f5c78..0000000
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestRecreateMasterlessAM.groovy
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.slider.providers.hbase.minicluster.masterless
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.core.exceptions.ErrorStrings
-import org.apache.slider.core.exceptions.SliderException
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase
-import org.apache.slider.core.main.ServiceLauncher
-import org.junit.Test
-
-/**
- * create masterless AMs and work with them. This is faster than
- * bringing up full clusters
- */
-@CompileStatic
-@Slf4j
-
-class TestRecreateMasterlessAM extends HBaseMiniClusterTestBase {
-
- @Test
- public void testRecreateMasterlessAM() throws Throwable {
- String clustername = "test_recreate_masterless_am"
- createMiniCluster(clustername, getConfiguration(), 1, true)
-
- describe "create a masterless AM, stop it, try to create" +
- "a second cluster with the same name"
-
- ServiceLauncher launcher = createMasterlessAM(clustername, 0, true, true)
- SliderClient sliderClient = (SliderClient) launcher.service
- addToTeardown(sliderClient);
- clusterActionFreeze(sliderClient, clustername)
-
- //now try to create instance #2, and expect an in-use failure
- try {
- createMasterlessAM(clustername, 0, false, false)
- fail("expected a failure")
- } catch (SliderException e) {
- assertExceptionDetails(e,
- SliderExitCodes.EXIT_INSTANCE_EXISTS,
- ErrorStrings.E_ALREADY_EXISTS)
- }
-
- }
-
-
-}
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestSliderConfDirToMasterlessAM.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestSliderConfDirToMasterlessAM.groovy
index 45e5a0a..2cdf2bb 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestSliderConfDirToMasterlessAM.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestSliderConfDirToMasterlessAM.groovy
@@ -84,9 +84,6 @@
SliderUtils.deleteDirectoryTree(localConf)
}
-
-
}
-
}