You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/10/24 22:51:24 UTC
[3/9] git commit: SLIDER-306 test checks are not consistent with
current listing semantics: succeeds if live or not live cluster is in the
history
SLIDER-306 test checks are not consistent with current listing semantics: succeeds if live or not live cluster is in the history
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/894f5c10
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/894f5c10
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/894f5c10
Branch: refs/heads/develop
Commit: 894f5c10f30695f7617ecb0ae19ed350b8b723bb
Parents: 74f2ff6
Author: Steve Loughran <st...@apache.org>
Authored: Tue Aug 19 12:38:26 2014 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Fri Oct 24 21:51:10 2014 +0100
----------------------------------------------------------------------
.../slider/agent/actions/TestActionList.groovy | 58 +++++++++++++++++++-
1 file changed, 55 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/894f5c10/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionList.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionList.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionList.groovy
index f218484..dc0f620 100644
--- a/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionList.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/actions/TestActionList.groovy
@@ -23,6 +23,8 @@ 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.ActionListArgs
+import org.apache.slider.common.params.ActionThawArgs
import org.apache.slider.common.params.Arguments
import org.apache.slider.common.params.SliderActions
import org.apache.slider.core.exceptions.UnknownApplicationInstanceException
@@ -40,7 +42,7 @@ class TestActionList extends AgentMiniClusterTestBase {
@Before
public void setup() {
super.setup()
- createMiniCluster("", configuration, 1, false)
+ createMiniCluster("", configuration, 1, true)
}
/**
@@ -55,6 +57,7 @@ class TestActionList extends AgentMiniClusterTestBase {
testListAllUsersNoClusters()
testListLiveCluster()
testListMissingCluster()
+// testActionListHistory()
}
public void testListThisUserNoClusters() throws Throwable {
@@ -128,7 +131,7 @@ class TestActionList extends AgentMiniClusterTestBase {
}
public void testListMissingCluster() throws Throwable {
- describe("exec the status command against an unknown cluster")
+ describe("exec the list command against an unknown cluster")
ServiceLauncher<SliderClient> launcher
try {
@@ -138,7 +141,7 @@ class TestActionList extends AgentMiniClusterTestBase {
//varargs list of command line params
[
SliderActions.ACTION_LIST,
- createClusterName()
+ "no-instance"
]
)
fail("expected an exception, got a status code " + launcher.serviceExitCode)
@@ -148,4 +151,53 @@ class TestActionList extends AgentMiniClusterTestBase {
}
+ @Test
+ public void testActionListHistory() {
+ String clustername = createClusterName()
+ ServiceLauncher<SliderClient> launcher = createStandaloneAM(
+ clustername,
+ true,
+ true)
+ addToTeardown(launcher)
+ SliderClient sliderClient = launcher.service
+ waitForClusterLive(sliderClient)
+
+ ActionListArgs args = new ActionListArgs();
+ //Listing only live instances
+ args.live = true;
+ assert sliderClient.actionList(clustername, args) == 0;
+ clusterActionFreeze(sliderClient, clustername, "stopping first cluster")
+ waitForAppToFinish(sliderClient)
+
+ //Listing only live instances but prints nothing since instance is freezed/stopped
+
+ args.live = true;
+ args.history = false;
+ try {
+ int exitCode = sliderClient.actionList(clustername, args);
+ fail("expected an exception, got a status code $exitCode")
+ } catch (UnknownApplicationInstanceException expected) {
+ }
+
+ // historical list will work
+ args.history = true;
+ assert sliderClient.actionList(clustername, args) == 0;
+
+ // thaw
+ ActionThawArgs thawArgs = new ActionThawArgs();
+ sliderClient.actionThaw(clustername, thawArgs);
+ waitForClusterLive(sliderClient)
+
+ //Listing only live instances
+ args.live = true;
+ args.history = false;
+ assert 0 == sliderClient.actionList(clustername, args);
+ assert launcher.serviceExitCode == 0
+
+ //Listing all the instance both history (previously freezed instance) and live
+ args.live = true
+ args.history = true
+ assert 0 == sliderClient.actionList("", args);
+ }
+
}