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/11/05 21:35:23 UTC

[1/5] git commit: SLIDER-525. Storm app package for windows does not report component status correctly HBase Win package has the ability to provide custom ports for Thrift and Thrift2

Repository: incubator-slider
Updated Branches:
  refs/heads/feature/SLIDER-616_re-enable_AMFailuresIT bb28c5146 -> adb98ee86 (forced update)


SLIDER-525. Storm app package for windows does not report component status correctly
HBase Win package has the ability to provide custom ports for Thrift and Thrift2


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/66b1aa4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/66b1aa4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/66b1aa4a

Branch: refs/heads/feature/SLIDER-616_re-enable_AMFailuresIT
Commit: 66b1aa4a403bfe60c026b63f201f8cdc539f2dfe
Parents: 0fe9f57
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Wed Nov 5 09:00:06 2014 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Wed Nov 5 09:00:10 2014 -0800

----------------------------------------------------------------------
 app-packages/hbase-win/README.txt               |  2 +-
 .../hbase-win/package/scripts/hbase_service.py  | 13 +++++++++
 .../hbase-win/package/scripts/params.py         | 10 ++++---
 app-packages/hbase-win/resources-default.json   | 14 ++++-----
 .../storm-win/package/scripts/nimbus.py         |  2 +-
 .../storm-win/package/scripts/rest_api.py       |  2 +-
 .../storm-win/package/scripts/service.py        | 30 ++++++++++++++++----
 .../storm-win/package/scripts/supervisor.py     |  2 +-
 .../storm-win/package/scripts/ui_server.py      |  2 +-
 .../src/main/python/agent/Controller.py         |  2 +-
 10 files changed, 56 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/app-packages/hbase-win/README.txt
----------------------------------------------------------------------
diff --git a/app-packages/hbase-win/README.txt b/app-packages/hbase-win/README.txt
index a413e76..6389fb2 100644
--- a/app-packages/hbase-win/README.txt
+++ b/app-packages/hbase-win/README.txt
@@ -30,7 +30,7 @@ mvn clean package -Phbase-app-package-win -Dpkg.version=<version>
    -Dpkg.name=<file name of app zip file> -Dpkg.src=<folder location where the pkg is available>
 
 Example:
-mvn clean package -Phbase-app-package -Dpkg.version=0.98.5-hadoop2
+mvn clean package -Phbase-app-package-win -Dpkg.version=0.98.5-hadoop2
   -Dpkg.name=hbase-0.98.5-hadoop2-bin.zip
   -Dpkg.src=/Users/user1/Downloads
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/app-packages/hbase-win/package/scripts/hbase_service.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-win/package/scripts/hbase_service.py b/app-packages/hbase-win/package/scripts/hbase_service.py
index 9a8dc56..e269531 100644
--- a/app-packages/hbase-win/package/scripts/hbase_service.py
+++ b/app-packages/hbase-win/package/scripts/hbase_service.py
@@ -28,6 +28,8 @@ def hbase_service(
   import params
 
   pid_file = format("{pid_dir}/hbase-{hbase_user}-{name}.pid")
+  custom_port = None
+  custom_info_port = None
   heap_size = params.master_heapsize
   main_class = "org.apache.hadoop.hbase.master.HMaster"
   if name == "regionserver":
@@ -36,12 +38,17 @@ def hbase_service(
   if name == "rest":
     heap_size = params.restserver_heapsize
     main_class = "org.apache.hadoop.hbase.rest.RESTServer"
+    custom_port = params.rest_port
   if name == "thrift":
     heap_size = params.thriftserver_heapsize
     main_class = "org.apache.hadoop.hbase.thrift.ThriftServer"
+    custom_port = params.thrift_port
+    custom_info_port = params.thrift_info_port
   if name == "thrift2":
     heap_size = params.thrift2server_heapsize
     main_class = "org.apache.hadoop.hbase.thrift2.ThriftServer"
+    custom_port = params.thrift2_port
+    custom_info_port = params.thrift2_info_port
 
   role_user = format("{hbase_user}-{name}")
 
@@ -49,6 +56,12 @@ def hbase_service(
 
   process_cmd = format("{java64_home}\\bin\\java {rest_of_the_command} {main_class} {action}")
 
+  if custom_port:
+    process_cmd = format("{process_cmd} -p {custom_port}")
+
+  if custom_info_port:
+    process_cmd = format("{process_cmd} --infoport {custom_info_port}")
+
   Execute(process_cmd,
           logoutput=False,
           wait_for_finish=False,

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/app-packages/hbase-win/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-win/package/scripts/params.py b/app-packages/hbase-win/package/scripts/params.py
index 4f55cd0..90d274c 100644
--- a/app-packages/hbase-win/package/scripts/params.py
+++ b/app-packages/hbase-win/package/scripts/params.py
@@ -42,11 +42,13 @@ input_conf_files_dir = config['configurations']['global']['app_input_conf_dir']
 hbase_hdfs_root_dir = config['configurations']['hbase-site']['hbase.rootdir']
 
 """
-Read various ports, unused as of now
+Read various ports
 """
-rest_port = config['configurations']['global']['hbase_rest_port']
-thrift_port = config['configurations']['global']['hbase_thrift_port']
-thrift2_port = config['configurations']['global']['hbase_thrift2_port']
+rest_port = default("configurations/global/hbase_rest_port", 1700)
+thrift_port = default("configurations/global/hbase_thrift_port", 9090)
+thrift2_port = default("configurations/global/hbase_thrift2_port", 9091)
+thrift_info_port = default("configurations/global/hbase_info_thrift_port", 9095)
+thrift2_info_port = default("configurations/global/hbase_info_thrift2_port", 9096)
 
 """
 Compute or read various heap sizes

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/app-packages/hbase-win/resources-default.json
----------------------------------------------------------------------
diff --git a/app-packages/hbase-win/resources-default.json b/app-packages/hbase-win/resources-default.json
index e451c51..93dc17c 100644
--- a/app-packages/hbase-win/resources-default.json
+++ b/app-packages/hbase-win/resources-default.json
@@ -10,7 +10,7 @@
     "HBASE_MASTER": {
       "yarn.role.priority": "1",
       "yarn.component.instances": "1",
-      "yarn.memory": "256"
+      "yarn.memory": "512"
     },
     "slider-appmaster": {
       "yarn.memory": "1024"
@@ -18,22 +18,22 @@
     "HBASE_REGIONSERVER": {
       "yarn.role.priority": "2",
       "yarn.component.instances": "1",
-      "yarn.memory": "256"
+      "yarn.memory": "512"
     },
     "HBASE_REST": {
       "yarn.role.priority": "3",
       "yarn.component.instances": "1",
-      "yarn.memory": "256"
+      "yarn.memory": "512"
     },
     "HBASE_THRIFT": {
       "yarn.role.priority": "4",
-      "yarn.component.instances": "0",
-      "yarn.memory": "256"
+      "yarn.component.instances": "1",
+      "yarn.memory": "512"
     },
     "HBASE_THRIFT2": {
       "yarn.role.priority": "5",
-      "yarn.component.instances": "1",
-      "yarn.memory": "256"
+      "yarn.component.instances": "0",
+      "yarn.memory": "512"
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/app-packages/storm-win/package/scripts/nimbus.py
----------------------------------------------------------------------
diff --git a/app-packages/storm-win/package/scripts/nimbus.py b/app-packages/storm-win/package/scripts/nimbus.py
index fafc97a..c7c3120 100644
--- a/app-packages/storm-win/package/scripts/nimbus.py
+++ b/app-packages/storm-win/package/scripts/nimbus.py
@@ -49,7 +49,7 @@ class Nimbus(Script):
   def status(self, env):
     import status_params
     env.set_params(status_params)
-    #check_process_status(status_params.pid_nimbus)
+    check_process_status(status_params.pid_nimbus)
 
 if __name__ == "__main__":
   Nimbus().execute()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/app-packages/storm-win/package/scripts/rest_api.py
----------------------------------------------------------------------
diff --git a/app-packages/storm-win/package/scripts/rest_api.py b/app-packages/storm-win/package/scripts/rest_api.py
index 6a09e4e..33d8924 100644
--- a/app-packages/storm-win/package/scripts/rest_api.py
+++ b/app-packages/storm-win/package/scripts/rest_api.py
@@ -51,7 +51,7 @@ class StormRestApi(Script):
   def status(self, env):
     import status_params
     env.set_params(status_params)
-    #check_process_status(status_params.pid_rest_api)
+    check_process_status(status_params.pid_rest_api)
 
 if __name__ == "__main__":
   StormRestApi().execute()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/app-packages/storm-win/package/scripts/service.py
----------------------------------------------------------------------
diff --git a/app-packages/storm-win/package/scripts/service.py b/app-packages/storm-win/package/scripts/service.py
index b17c636..aa7d339 100644
--- a/app-packages/storm-win/package/scripts/service.py
+++ b/app-packages/storm-win/package/scripts/service.py
@@ -20,9 +20,9 @@ limitations under the License.
 
 
 from resource_management import *
-import time
 import os
 import sys
+import xml.etree.ElementTree as et
 
 """
 Slider package uses jps as pgrep does not list the whole process start command
@@ -40,14 +40,32 @@ def service(
     os.environ['STORM_LOG_DIR'] = params.log_dir
     os.environ['STORM_HOME'] = params.app_root
     os.environ['STORM_CONF_DIR'] = params.conf_dir
-    cmd = format("{storm_bin} {name} > {log_dir}/{name}.out 2>&1")
 
-    Execute(cmd,
-            logoutput=False,
-            wait_for_finish=False,
-            pid_file = pid_file
+    generate_xml = format("{storm_bin} --service {name} > {log_dir}/{name}.cmd")
+
+    Execute(generate_xml,
+            logoutput=True,
+            wait_for_finish=True
     )
 
+    tree = et.parse(format("{log_dir}/{name}.cmd"))
+    root = tree.getroot()
+    cmd_part = None
+    for child in root:
+      if child.tag == "arguments":
+        cmd_part = child.text
+
+    if cmd_part:
+      cmd = format("{java64_home}\\bin\\java {cmd_part}")
+
+      Execute(cmd,
+              logoutput=False,
+              wait_for_finish=False,
+              pid_file=pid_file
+      )
+    else:
+      Logger.warn("Valid command file did not get generated at " + format("{log_dir}/{name}.cmd"))
+
   elif action == "stop":
     pid = format("`cat {pid_file}` >/dev/null 2>&1")
     Execute(format("kill {pid}")

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/app-packages/storm-win/package/scripts/supervisor.py
----------------------------------------------------------------------
diff --git a/app-packages/storm-win/package/scripts/supervisor.py b/app-packages/storm-win/package/scripts/supervisor.py
index eba9fa9..47c20c9 100644
--- a/app-packages/storm-win/package/scripts/supervisor.py
+++ b/app-packages/storm-win/package/scripts/supervisor.py
@@ -53,7 +53,7 @@ class Supervisor(Script):
     import status_params
     env.set_params(status_params)
 
-    #check_process_status(status_params.pid_supervisor)
+    check_process_status(status_params.pid_supervisor)
 
 
 if __name__ == "__main__":

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/app-packages/storm-win/package/scripts/ui_server.py
----------------------------------------------------------------------
diff --git a/app-packages/storm-win/package/scripts/ui_server.py b/app-packages/storm-win/package/scripts/ui_server.py
index 0875b76..0fe7cd2 100644
--- a/app-packages/storm-win/package/scripts/ui_server.py
+++ b/app-packages/storm-win/package/scripts/ui_server.py
@@ -49,7 +49,7 @@ class UiServer(Script):
   def status(self, env):
     import status_params
     env.set_params(status_params)
-    #check_process_status(status_params.pid_ui)
+    check_process_status(status_params.pid_ui)
 
 if __name__ == "__main__":
   UiServer().execute()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/66b1aa4a/slider-agent/src/main/python/agent/Controller.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/main/python/agent/Controller.py b/slider-agent/src/main/python/agent/Controller.py
index fe7047d..387bc7e 100644
--- a/slider-agent/src/main/python/agent/Controller.py
+++ b/slider-agent/src/main/python/agent/Controller.py
@@ -295,7 +295,7 @@ class Controller(threading.Thread):
         if 'restartEnabled' in response:
           restartEnabled = response['restartEnabled']
           if restartEnabled:
-            logger.info("Component auto-restart is enabled.")
+            logger.debug("Component auto-restart is enabled.")
 
         if 'hasMappedComponents' in response.keys():
           self.hasMappedComponents = response['hasMappedComponents'] != False


[5/5] git commit: SLIDER-616 re-enable AMFailuresIT

Posted by st...@apache.org.
SLIDER-616 re-enable AMFailuresIT


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/adb98ee8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/adb98ee8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/adb98ee8

Branch: refs/heads/feature/SLIDER-616_re-enable_AMFailuresIT
Commit: adb98ee86c5ebb0c9867ca83c20bbaec548e5b48
Parents: 8943a14
Author: Steve Loughran <st...@apache.org>
Authored: Wed Nov 5 20:28:12 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Wed Nov 5 20:35:02 2014 +0000

----------------------------------------------------------------------
 .../apache/slider/test/SliderTestUtils.groovy   |  23 ++-
 .../funtest/framework/CommandTestBase.groovy    |  98 +++++++---
 .../funtest/lifecycle/AMFailuresIT.groovy       |  29 +--
 .../lifecycle/AgentClusterLifecycleIT.groovy    |   6 +-
 .../funtest/lifecycle/AgentFailures2IT.groovy   |   2 +-
 .../funtest/lifecycle/AgentFailuresIT.groovy    |   2 +-
 .../lifecycle/AgentLaunchFailureIT.groovy       |   2 +-
 .../funtest/lifecycle/AgentRegistryIT.groovy    |   8 +-
 .../lifecycle/AppsThroughAgentDemo.groovy       | 139 +-------------
 .../funtest/lifecycle/AppsThroughAgentIT.groovy | 181 ++++++++++++-------
 .../AppsThroughAgentQueueAndLabelsIT.groovy     |   2 +-
 11 files changed, 238 insertions(+), 254 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
----------------------------------------------------------------------
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 1afbafc..3b1d022 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
@@ -938,12 +938,19 @@ class SliderTestUtils extends Assert {
    * @param failureMessage message to include in exception raised
    * @param failureHandler closure to invoke prior to the failure being raised
    */
-  protected void repeatUntilSuccess(Closure probe,
-      int timeout, int sleepDur,
+  protected void repeatUntilSuccess(
+      String action,
+      Closure probe,
+      int timeout,
+      int sleepDur,
       Map args,
       boolean failIfUnsuccessful,
       String failureMessage,
       Closure failureHandler) {
+    log.debug("Probe $action timelimit $timeout")
+    if (timeout < 1000) {
+      fail("Timeout $timeout too low: milliseconds are expected, not seconds")
+    }
     int attemptCount = 0
     boolean succeeded = false;
     boolean completed = false;
@@ -961,19 +968,25 @@ class SliderTestUtils extends Assert {
         attemptCount++;
         completed = duration.limitExceeded
         if (!completed) {
+          log.debug("Attempt $attemptCount failed")
           sleep(sleepDur)
         }
       } else if (outcome.equals(Outcome.Fail)) {
         // fast fail
+        log.debug("Fast fail of probe")
         completed = true;
       }
     }
-
-    if (failIfUnsuccessful & !succeeded) {
+    if (!succeeded) {
+      if (duration.limitExceeded) {
+        log.info("probe timed out after $timeout and $attemptCount attempts")
+      }
       if (failureHandler) {
         failureHandler()
       }
-      fail(failureMessage)
+      if (failIfUnsuccessful) {
+        fail(failureMessage)
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
index 7d369d5..1d436da 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
@@ -511,7 +511,7 @@ abstract class CommandTestBase extends SliderTestUtils {
     if (!shell.outputContains(lookThisUp)) {
       log.error("Missing $lookThisUp from:")
       shell.dumpOutput()
-      assert shell.outputContains(lookThisUp)
+      fail("Missing $lookThisUp from:\n$shell.out\n$shell.err" )
     }
   }
   
@@ -629,7 +629,7 @@ abstract class CommandTestBase extends SliderTestUtils {
       File launchReportFile = null) {
 
     if (!launchReportFile) {
-      launchReportFile = createAppReportFile()
+      launchReportFile = createTempJsonFile()
     }
     // delete any previous copy of the file
     launchReportFile.delete();
@@ -678,10 +678,19 @@ abstract class CommandTestBase extends SliderTestUtils {
     return shell
   }
 
-  public static  File createAppReportFile() {
+  /**
+   * Create a temp JSON file. After coming up with the name, the file
+   * is deleted
+   * @return the filename
+   */
+  public static  File createTempJsonFile() {
+    return tmpFile(".json")
+  }
+
+  public static File tmpFile(String suffix) {
     File reportFile = File.createTempFile(
         "launch",
-        ".json",
+        suffix,
         new File("target"))
     reportFile.delete()
     return reportFile
@@ -737,7 +746,7 @@ abstract class CommandTestBase extends SliderTestUtils {
    * @return an application report or null
    */
   public static SerializedApplicationReport lookupApplication(String id) {
-    File reportFile = createAppReportFile();
+    File reportFile = createTempJsonFile();
     try {
       def shell = lookup(id, reportFile)
       if (shell.ret == 0) {
@@ -789,11 +798,15 @@ abstract class CommandTestBase extends SliderTestUtils {
     slider(0, [
         ACTION_AM_SUICIDE, application,
         ARG_EXITCODE, "1",
-        ARG_WAIT, "1000",
+        ARG_WAIT, "500",
         ARG_MESSAGE, "suicide"
     ])
 
-    sleep(5000)
+    // app gets accepted
+    log.info "awaiting app to enter ACCEPTED state"
+    awaitYarnApplicationAccepted(appId)
+    // app goes live
+    log.info "awaiting app to enter RUNNING state"
     ensureYarnApplicationIsUp(appId)
   }
 
@@ -802,7 +815,8 @@ abstract class CommandTestBase extends SliderTestUtils {
    * @param application application
    */
   protected void ensureRegistryCallSucceeds(String application) {
-    repeatUntilSuccess(this.&isRegistryAccessible,
+    repeatUntilSuccess("registry",
+        this.&isRegistryAccessible,
         REGISTRY_STARTUP_TIMEOUT,
         PROBE_SLEEP_TIME,
         [application: application],
@@ -823,9 +837,9 @@ abstract class CommandTestBase extends SliderTestUtils {
    * @param application
    */
   protected void ensureApplicationIsUp(String application) {
-    repeatUntilSuccess(this.&isApplicationRunning,
-        SLIDER_CONFIG.getInt(KEY_TEST_INSTANCE_LAUNCH_TIME,
-            DEFAULT_INSTANCE_LAUNCH_TIME_SECONDS) * 1000,
+    repeatUntilSuccess("await application up",
+        this.&isApplicationRunning,
+        instanceLaunchTime,
         PROBE_SLEEP_TIME,
         [application: application],
         true,
@@ -898,9 +912,22 @@ abstract class CommandTestBase extends SliderTestUtils {
    * @return
    */
 
-  protected Outcome isYarnApplicationRunning(Map<String, String> args) {
+  protected static Outcome isYarnApplicationRunning(Map<String, String> args) {
+    String applicationId = args['applicationId'];
+    return isYarnApplicationInState(applicationId,
+        YarnApplicationState.RUNNING, true)
+  }
+
+  /**
+   * Probe callback for is the the app running or not
+   * @param args map where 'applicationId' must m
+   * @return
+   */
+  protected static Outcome isYarnApplicationInExactState(Map<String, String> args) {
     String applicationId = args['applicationId'];
-    return isYarnApplicationRunning(applicationId)
+    String state = args['state']
+    def desired = YarnApplicationState.valueOf(state)
+    return isYarnApplicationInState(applicationId, desired, false)
   }
 
   /**
@@ -912,8 +939,8 @@ abstract class CommandTestBase extends SliderTestUtils {
    */
   public static Outcome isYarnApplicationRunning(
       String applicationId) {
-    YarnApplicationState yarnState = YarnApplicationState.RUNNING
-    return isYarnApplicationInState(applicationId, yarnState)
+    return isYarnApplicationInState(applicationId,
+        YarnApplicationState.RUNNING, true)
   }
 
   /**
@@ -924,14 +951,14 @@ abstract class CommandTestBase extends SliderTestUtils {
    * above it
    */
   public static Outcome isYarnApplicationInState(
-      String applicationId,
-      YarnApplicationState yarnState) {
+      String applicationId, YarnApplicationState yarnState, boolean failfast) {
     YarnApplicationState appState = lookupYarnAppState(applicationId)
     if (yarnState == appState) {
       return Outcome.Success;
     }
 
-    if (appState.ordinal() > yarnState.ordinal()) {
+    if (failfast && appState.ordinal() > yarnState.ordinal()) {
+      log.debug("App state $appState past desired state $yarnState: failing")
       // app has passed beyond hope
       return Outcome.Fail
     }
@@ -977,13 +1004,14 @@ abstract class CommandTestBase extends SliderTestUtils {
    * @param applicationId
    */
   protected void ensureYarnApplicationIsUp(String applicationId) {
-    repeatUntilSuccess(this.&isYarnApplicationRunning,
+    repeatUntilSuccess("await yarn application Running",
+        this.&isYarnApplicationRunning,
         instanceLaunchTime,
         PROBE_SLEEP_TIME,
         [applicationId: applicationId],
         true,
         E_LAUNCH_FAIL) {
-      describe "final state of app that tests say is not up"
+      describe "final state of application"
       def sar = lookupApplication(applicationId)
 
       def message = E_LAUNCH_FAIL + "\n$sar"
@@ -993,6 +1021,27 @@ abstract class CommandTestBase extends SliderTestUtils {
   }
 
   /**
+   * Wait for the YARN app to come up. This will fail fast
+   * @param applicationId
+   */
+  protected void awaitYarnApplicationAccepted(String applicationId) {
+    repeatUntilSuccess("Await Yarn App Accepted",
+        this.&isYarnApplicationInExactState,
+        instanceLaunchTime,
+        1000,
+        [applicationId: applicationId,
+         state: YarnApplicationState.ACCEPTED.toString()],
+        true,
+        "application never reached accepted state") {
+      describe "app did not enter accepted"
+      def sar = lookupApplication(applicationId)
+
+      def message = 'Application did not enter ACCEPTED state' + "\n$sar"
+      log.error(message)
+      fail(message)
+    }
+  }
+  /**
    * Get the expected launch time. Default is the configuration option
    * {@link FuntestProperties#KEY_TEST_INSTANCE_LAUNCH_TIME} and
    * default value {@link FuntestProperties#KEY_TEST_INSTANCE_LAUNCH_TIME}
@@ -1000,7 +1049,7 @@ abstract class CommandTestBase extends SliderTestUtils {
    */
   public int getInstanceLaunchTime() {
     return SLIDER_CONFIG.getInt(KEY_TEST_INSTANCE_LAUNCH_TIME,
-        DEFAULT_INSTANCE_LAUNCH_TIME_SECONDS)
+        DEFAULT_INSTANCE_LAUNCH_TIME_SECONDS) * 1000;
   }
 
   public String getInfoAmWebUrl(String applicationName) {
@@ -1045,6 +1094,11 @@ abstract class CommandTestBase extends SliderTestUtils {
     return requested
   }
 
+  /**
+   * Probe: has the requested container count of a specific role been reached?
+   * @param args map with: "application", "role", "limit"
+   * @return success on a match, retry if not
+   */
   Outcome hasRequestedContainerCountReached(Map<String, String> args) {
     String application = args['application']
     String role = args['role']
@@ -1059,6 +1113,7 @@ abstract class CommandTestBase extends SliderTestUtils {
       int container_launch_timeout) {
 
     repeatUntilSuccess(
+        "await container count",
         this.&hasRequestedContainerCountReached,
         container_launch_timeout,
         PROBE_SLEEP_TIME,
@@ -1119,6 +1174,7 @@ abstract class CommandTestBase extends SliderTestUtils {
       int container_launch_timeout) {
 
     repeatUntilSuccess(
+        "await live container count",
         this.&hasLiveContainerCountReached,
         container_launch_timeout,
         PROBE_SLEEP_TIME,

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
index 6238164..0544b22 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
@@ -43,7 +43,7 @@ public class AMFailuresIT extends AgentCommandTestBase
 implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
   private static String COMMAND_LOGGER = "COMMAND_LOGGER"
-  private static String APPLICATION_NAME = "am-started-agents-started"
+  private static String APPLICATION_NAME = "am-failures-it"
   public static final String TEST_REMOTE_SSH_KEY = "test.remote.ssh.key"
   public static final String VAGRANT_CWD = "vagrant.current.working.dir"
   File sshkey
@@ -61,7 +61,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
   @Test
   public void testAMKilledWithStateAMStartedAgentsStarted() throws Throwable {
     cleanup(APPLICATION_NAME)
-    File launchReportFile = createAppReportFile();
+    File launchReportFile = createTempJsonFile();
 
     SliderShell shell = createTemplatedSliderApplication(
         APPLICATION_NAME, APP_TEMPLATE, APP_RESOURCE,
@@ -84,37 +84,20 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
     // Now kill the AM
     log.info("Killing AM now ...")
-//    killAMUsingJsch()
     killAmAndWaitForRestart(APPLICATION_NAME, appId)
 
     // There should be exactly 1 live logger container
     def cd2 = assertContainersLive(APPLICATION_NAME, COMMAND_LOGGER, 1)
 
     // No new containers should be requested for the agents
-    def loggerStats2 = cd2.statistics[COMMAND_LOGGER]
-    assert loggerStats["containers.requested"] == loggerStats2["containers.requested"],
+    def restartedStats = cd2.statistics[COMMAND_LOGGER]
+    assert restartedStats["containers.live"] == 1
+
+    assert 0==restartedStats["containers.requested"],
         'No new agent containers should be requested'
     assert lookupYarnAppState(appId) == YarnApplicationState.RUNNING 
   }
 
-  /**
-   * Allow for 2x as long as other test instances, as for AM restart we
-   * need to allow for a longer delay
-   */
-  @Override
-  int getInstanceLaunchTime() {
-    return 2* super.instanceLaunchTime
-  }
-
-  protected void killAMUsingAmSuicide() {
-    SliderShell shell = slider(EXIT_SUCCESS,
-      [
-          ACTION_AM_SUICIDE,
-          ARG_MESSAGE, "testAMRestart",
-          APPLICATION_NAME])
-    logShell(shell)
-  }
-
   protected void killAMUsingVagrantShell() {
     String hostname = SLIDER_CONFIG.get(YarnConfiguration.RM_ADDRESS).split(":")[0]
     assert hostname

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentClusterLifecycleIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentClusterLifecycleIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentClusterLifecycleIT.groovy
index a0cb6ca..0bc4e39 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentClusterLifecycleIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentClusterLifecycleIT.groovy
@@ -67,7 +67,7 @@ public class AgentClusterLifecycleIT extends AgentCommandTestBase
     def clusterpath = buildClusterPath(CLUSTER)
     assert !clusterFS.exists(clusterpath)
 
-    File launchReportFile = createAppReportFile();
+    File launchReportFile = createTempJsonFile();
     SliderShell shell = createTemplatedSliderApplication(CLUSTER,
         APP_TEMPLATE,
         APP_RESOURCE2,
@@ -158,7 +158,7 @@ public class AgentClusterLifecycleIT extends AgentCommandTestBase
       list(-1, [ARG_STATE, "running"])
       list( 0, [ARG_STATE, "FINISHED"])
 
-      def thawReport = createAppReportFile()
+      def thawReport = createTempJsonFile()
       //start then stop the cluster
       thaw(CLUSTER,
           [
@@ -198,7 +198,7 @@ public class AgentClusterLifecycleIT extends AgentCommandTestBase
       //start with a restart count set to enable restart
       describe "the kill/restart phase may fail if yarn.resourcemanager.am.max-attempts is too low"
 
-      def thawReport2 = createAppReportFile()
+      def thawReport2 = createTempJsonFile()
       //start then stop the cluster
       thaw(CLUSTER,
           [

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailures2IT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailures2IT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailures2IT.groovy
index bfae6ec..39b5d6c 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailures2IT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailures2IT.groovy
@@ -50,7 +50,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
     assumeAgentTestsEnabled()
     
     cleanup(APPLICATION_NAME)
-    File launchReportFile = createAppReportFile();
+    File launchReportFile = createTempJsonFile();
 
     SliderShell shell = createTemplatedSliderApplication(
         APPLICATION_NAME, APP_TEMPLATE3, APP_RESOURCE,

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailuresIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailuresIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailuresIT.groovy
index a6930b2..7d1be89 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailuresIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailuresIT.groovy
@@ -52,7 +52,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
     cleanup(APPLICATION_NAME)
 
-    File launchReportFile = createAppReportFile();
+    File launchReportFile = createTempJsonFile();
     SliderShell shell = createTemplatedSliderApplication(
         APPLICATION_NAME,
         APP_TEMPLATE2,

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentLaunchFailureIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentLaunchFailureIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentLaunchFailureIT.groovy
index 791123c..2e1ca0f 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentLaunchFailureIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentLaunchFailureIT.groovy
@@ -60,7 +60,7 @@ public class AgentLaunchFailureIT extends AgentCommandTestBase
     assert 0 != exists(CLUSTER).ret
  
     // create an AM which fails to launch
-    File launchReportFile = createAppReportFile();
+    File launchReportFile = createTempJsonFile();
     createTemplatedSliderApplication(CLUSTER,
         APP_TEMPLATE,
         APP_RESOURCE2,

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy
index fe63660..4f9701c 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy
@@ -24,13 +24,10 @@ import org.apache.hadoop.registry.client.binding.RegistryUtils
 import org.apache.hadoop.registry.client.types.Endpoint
 import org.apache.hadoop.registry.client.types.ServiceRecord
 import org.apache.hadoop.yarn.api.records.YarnApplicationState
-import org.apache.slider.client.SliderClient
 import org.apache.slider.common.SliderExitCodes
 import org.apache.slider.common.SliderKeys
-import org.apache.slider.common.params.ActionResolveArgs
 import org.apache.slider.common.params.Arguments
 import org.apache.slider.common.params.SliderActions
-import org.apache.slider.core.exceptions.NotFoundException
 import org.apache.slider.test.Outcome
 
 import static org.apache.slider.core.registry.info.CustomRegistryConstants.*
@@ -66,7 +63,7 @@ public class AgentRegistryIT extends AgentCommandTestBase
   public void testAgentRegistry() throws Throwable {
     describe("Create a 0-role cluster and make registry queries against it")
     def clusterpath = buildClusterPath(CLUSTER)
-    File launchReportFile = createAppReportFile();
+    File launchReportFile = createTempJsonFile();
     SliderShell shell = createTemplatedSliderApplication(CLUSTER,
         APP_TEMPLATE,
         APP_RESOURCE2,
@@ -143,7 +140,8 @@ public class AgentRegistryIT extends AgentCommandTestBase
     exists(EXIT_UNKNOWN_INSTANCE, CLUSTER)
 
 
-    repeatUntilSuccess(this.&probeForEntryMissing, 10000, 1000,
+    repeatUntilSuccess("probe for missing registry entry",
+        this.&probeForEntryMissing, 10000, 1000,
         [path: appPath],
         true,
         "registry entry never deleted") {

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentDemo.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentDemo.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentDemo.groovy
index 1d65ce7..0f940cf 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentDemo.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentDemo.groovy
@@ -29,138 +29,17 @@ import org.apache.slider.funtest.framework.SliderShell
 import org.junit.Before
 import org.junit.Test
 
+/**
+ * For a quick demo of a slider app; this starts the apps through agent test but
+ * neglects to tear it down afterwards
+ */
 @CompileStatic
 @Slf4j
-public class AppsThroughAgentDemo extends AgentCommandTestBase
-implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
-
-  private static String COMMAND_LOGGER = "COMMAND_LOGGER"
-  private static String APPLICATION_NAME = "agent-demo"
-
-
-  @Before
-  public void prepareCluster() {
-    setupCluster(APPLICATION_NAME)
-  }
-
-  @Test
-  public void testCreateFlex() throws Throwable {
-    assumeAgentTestsEnabled()
-
-    cleanup(APPLICATION_NAME)
-    File launchReportFile = createAppReportFile();
-
-    SliderShell shell = createTemplatedSliderApplication(APPLICATION_NAME,
-        APP_TEMPLATE,
-        APP_RESOURCE,
-        [],
-        launchReportFile)
-
-    logShell(shell)
-
-    def appId = ensureYarnApplicationIsUp(launchReportFile)
-
-    //flex
-    slider(EXIT_SUCCESS,
-        [
-            ACTION_FLEX,
-            APPLICATION_NAME,
-            ARG_COMPONENT,
-            COMMAND_LOGGER,
-            "2"])
-
-    // sleep till the new instance starts
-    sleep(1000 * 10)
-
-    slider(EXIT_SUCCESS,
-        [ACTION_STATUS,
-            APPLICATION_NAME])
-
-    assertContainersLive(APPLICATION_NAME, COMMAND_LOGGER, 2)
-
-    String amWebUrl = getInfoAmWebUrl(APPLICATION_NAME)
-    log.info("Dumping data from AM Web URL");
-    log.info(amWebUrl.toURL().text);
-
-    ensureRegistryCallSucceeds(APPLICATION_NAME)
-
-    // get log folders
-    shell = slider(EXIT_SUCCESS,
-        [
-            ACTION_REGISTRY,
-            ARG_NAME,
-            APPLICATION_NAME,
-            ARG_LISTEXP
-        ])
-    if(!containsString(shell, "container_log_dirs") ||
-       !containsString(shell, "container_work_dirs")) {
-      logShell(shell)
-      assert fail("Should list default exports container_log_dirs or container_work_dirs")
-    }
-
-    // get log folders
-    shell = slider(EXIT_SUCCESS,
-        [
-            ACTION_REGISTRY,
-            ARG_NAME,
-            APPLICATION_NAME,
-            ARG_GETEXP,
-            "container_log_dirs"
-        ])
-    if(!containsString(shell, "\"tag\" : \"COMMAND_LOGGER\"", 2)
-    || !containsString(shell, "\"level\" : \"component\"", 2)) {
-      logShell(shell)
-      assert fail("Should list 2 entries for log folders")
-    }
-
-    // get log folders
-    shell = slider(EXIT_SUCCESS,
-        [
-            ACTION_REGISTRY,
-            ARG_NAME,
-            APPLICATION_NAME,
-            ARG_GETEXP,
-            "container_work_dirs"
-        ])
-    if(!containsString(shell, "\"tag\" : \"COMMAND_LOGGER\"", 2)
-    || !containsString(shell, "\"level\" : \"component\"", 2)) {
-      logShell(shell)
-      assert fail("Should list 2 entries for work folder")
-    }
-
-    // get cl-site config
-    shell = slider(
-        [
-            ACTION_REGISTRY,
-            ARG_NAME,
-            APPLICATION_NAME,
-            ARG_GETCONF,
-            "cl-site",
-            ARG_FORMAT,
-            "json"
-        ])
-
-    for (int i = 0; i < 10; i++) {
-      if (shell.getRet() != EXIT_SUCCESS) {
-        println "Waiting for the cl-site to show up"
-        sleep(1000 * 10)
-        shell = slider(
-            [
-                ACTION_REGISTRY,
-                ARG_NAME,
-                APPLICATION_NAME,
-                ARG_GETCONF,
-                "cl-site",
-                ARG_FORMAT,
-                "json"])
-      }
-    }
-    assert shell.getRet() == EXIT_SUCCESS, "cl-site should be retrieved"
-    if (!containsString(shell, "\"pattern.for.test.to.verify\" : \"verify this pattern\"", 1)) {
-      logShell(shell)
-      assert fail("Should have exported cl-site")
-    }
+public class AppsThroughAgentDemo extends AppsThroughAgentIT {
 
-    assertAppRunning(appId)
+  @Override
+  void destroyCluster() {
+    super.destroyCluster()
   }
+  
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentIT.groovy
index 5cd6dc5..8ddc38f 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentIT.groovy
@@ -26,6 +26,7 @@ import org.apache.slider.common.params.SliderActions
 import org.apache.slider.funtest.framework.AgentCommandTestBase
 import org.apache.slider.funtest.framework.FuntestProperties
 import org.apache.slider.funtest.framework.SliderShell
+import org.apache.slider.test.Outcome
 import org.junit.After
 import org.junit.Before
 import org.junit.Test
@@ -43,6 +44,10 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
     setupCluster(APPLICATION_NAME)
   }
   
+  public String getApplicationName() {
+    return APPLICATION_NAME
+  }
+
   @After
   public void destroyCluster() {
     cleanup(APPLICATION_NAME)
@@ -52,9 +57,10 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
   public void testCreateFlex() throws Throwable {
     assumeAgentTestsEnabled()
 
-    cleanup(APPLICATION_NAME)
-    File launchReportFile = createAppReportFile();
-    SliderShell shell = createTemplatedSliderApplication(APPLICATION_NAME,
+    def application = APPLICATION_NAME
+    cleanup(application)
+    File launchReportFile = createTempJsonFile();
+    SliderShell shell = createTemplatedSliderApplication(application,
         APP_TEMPLATE,
         APP_RESOURCE,
         [],
@@ -67,7 +73,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
     slider(EXIT_SUCCESS,
         [
             ACTION_FLEX,
-            APPLICATION_NAME,
+            application,
             ARG_COMPONENT,
             COMMAND_LOGGER,
             "2"])
@@ -75,91 +81,140 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
     // sleep till the new instance starts
     sleep(1000 * 10)
 
-    status(0, APPLICATION_NAME)
-    expectLiveContainerCountReached(APPLICATION_NAME, COMMAND_LOGGER, 2,
+    status(0, application)
+    expectLiveContainerCountReached(application, COMMAND_LOGGER, 2,
         CONTAINER_LAUNCH_TIMEOUT)
 
-    String amWebUrl = getInfoAmWebUrl(APPLICATION_NAME)
+    String amWebUrl = getInfoAmWebUrl(application)
     log.info("Dumping data from AM Web URL");
     log.info(amWebUrl.toURL().text);
 
-    ensureRegistryCallSucceeds(APPLICATION_NAME)
+    ensureRegistryCallSucceeds(application)
+    def outfile = tmpFile(".txt")
+
+    assertAppRunning(appId)
 
+    def commands = [
+        ACTION_REGISTRY,
+        ARG_NAME,
+        application,
+        ARG_LISTEXP,
+        ARG_OUTPUT,
+        outfile.absolutePath
+    ]
+
+    awaitRegistryOutfileContains(outfile, commands, "container_log_dirs")
+    awaitRegistryOutfileContains(outfile, commands, "container_work_dirs")
     // get log folders
     shell = slider(EXIT_SUCCESS,
         [
             ACTION_REGISTRY,
             ARG_NAME,
-            APPLICATION_NAME,
+            application,
             ARG_LISTEXP])
-    if(!containsString(shell, "container_log_dirs") ||
-       !containsString(shell, "container_work_dirs")) {
-      logShell(shell)
-      assert fail("Should list default exports container_log_dirs or container_work_dirs")
-    }
+    assertOutputContains(shell, "container_log_dirs")
+    assertOutputContains(shell, "container_work_dirs")
 
     // get log folders
     shell = slider(EXIT_SUCCESS,
         [
             ACTION_REGISTRY,
             ARG_NAME,
-            APPLICATION_NAME,
+            application,
             ARG_GETEXP,
             "container_log_dirs"])
-    if (!containsString(shell, "\"tag\" : \"COMMAND_LOGGER\"", 2)
-        || !containsString(shell, "\"level\" : \"component\"", 2)) {
-      logShell(shell)
-      assert fail("Should list 2 entries for log folders")
-    }
 
-    // get log folders
-    shell = slider(EXIT_SUCCESS,
-        [
-            ACTION_REGISTRY,
-            ARG_NAME,
-            APPLICATION_NAME,
-            ARG_GETEXP,
-            "container_work_dirs"])
-    if(!containsString(shell, "\"tag\" : \"COMMAND_LOGGER\"", 2)
-    || !containsString(shell, "\"level\" : \"component\"", 2)) {
-      logShell(shell)
-      assert fail("Should list 2 entries for work folder")
-    }
+    assertOutputContains(shell, '"tag" : "COMMAND_LOGGER"', 2)
+    assertOutputContains(shell, '"level" : "level"', 2)
 
     // get cl-site config
-    shell = slider(
+
+    def getconf = [
+        ACTION_REGISTRY,
+        ARG_NAME,
+        application,
+        ARG_GETCONF,
+        "cl-site",
+        ARG_FORMAT,
+        "json"]
+
+    def pattern = '"pattern.for.test.to.verify" : "verify this pattern"'
+
+    repeatUntilSuccess("registry",
+        this.&commandSucceeds,
+        REGISTRY_STARTUP_TIMEOUT,
+        PROBE_SLEEP_TIME,
         [
-            ACTION_REGISTRY,
-            ARG_NAME,
-            APPLICATION_NAME,
-            ARG_GETCONF,
-            "cl-site",
-            ARG_FORMAT,
-            "json"])
-
-    for (int i = 0; i < 10; i++) {
-      if (shell.getRet() != EXIT_SUCCESS) {
-        println "Waiting for the cl-site to show up"
-        sleep(1000 * 10)
-        shell = slider(0,
-            [
-                ACTION_REGISTRY,
-                ARG_NAME,
-                APPLICATION_NAME,
-                ARG_GETCONF,
-                "cl-site",
-                ARG_FORMAT,
-                "json"])
-      }
-    }
-    if (!containsString(shell, "\"pattern.for.test.to.verify\" : \"verify this pattern\"", 1)) {
-      logShell(shell)
-      
-      fail("Should have exported cl-site; got " +
-                  "stdout"  +shell.stdErrHistory +
-                  " \nstderr:" + shell.stdErrHistory)
+            text: "pattern",
+            command: getconf
+        ],
+        true,
+        "failed to find $pattern in output") {
+      slider(0, getconf)
+      assertOutputContains(shell, pattern)
     }
 
     assertAppRunning(appId)
   }
+
+  public awaitRegistryOutfileContains(
+      File outfile,
+      List<String> commands,
+      String match) {
+    repeatUntilSuccess("registry",
+        this.&generatedFileContains,
+        REGISTRY_STARTUP_TIMEOUT * 2,
+        PROBE_SLEEP_TIME,
+        [
+            text    : match,
+            filename: outfile.absolutePath,
+            command : commands
+        ],
+        true,
+        "failed to find $match in output") {
+      slider(0, commands).dumpOutput()
+      fail("no $match in \n$outfile.text")
+    }
+  }
+
+  /**
+   * Is the registry accessible for an application?
+   * @param args argument map containing <code>"application"</code>
+   * @return probe outcome
+   */
+  protected Outcome commandOutputContains(Map args) {
+    String text = args['text'];
+    List<String> command = (List < String >)args['command']
+    SliderShell shell = slider(0, command)
+    return Outcome.fromBool(shell.outputContains(text))
+  }
+
+  /**
+   * Is the registry accessible for an application?
+   * @param args argument map containing <code>"application"</code>
+   * @return probe outcome
+   */
+  protected Outcome commandSucceeds(Map args) {
+    List<String> command = (List<String>) args['command']
+    SliderShell shell = slider(command)
+    return Outcome.fromBool(shell.ret == 0)
+  }
+
+  /**
+   * Is the registry accessible for an application?
+   * @param args argument map
+   * @return probe outcome
+   */
+  protected Outcome generatedFileContains(Map args) {
+    List<String> command = (List<String>) args['command']
+    String text = args['text'];
+    String filename = args['filename'];
+    File f = new File(filename)
+    f.delete()
+    SliderShell shell = slider(0, command)
+    shell.dumpOutput()
+    assert f.exists()
+    return Outcome.fromBool(f.text.contains(text))
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/adb98ee8/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentQueueAndLabelsIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentQueueAndLabelsIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentQueueAndLabelsIT.groovy
index 51bb440..4ef3905 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentQueueAndLabelsIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentQueueAndLabelsIT.groovy
@@ -81,7 +81,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
     assumeLabelsRedAndBlueAdded()
 
     cleanup(APPLICATION_NAME)
-    File launchReportFile = createAppReportFile();
+    File launchReportFile = createTempJsonFile();
     SliderShell shell = createTemplatedSliderApplication(
         APPLICATION_NAME,
         APP_TEMPLATE,


[3/5] git commit: SLIDER-619 registry list and listconf commands to save output to --out file

Posted by st...@apache.org.
SLIDER-619 registry list and listconf commands to save output to --out file


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/70c1b1a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/70c1b1a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/70c1b1a7

Branch: refs/heads/feature/SLIDER-616_re-enable_AMFailuresIT
Commit: 70c1b1a7b21e02abff825009d51ca40ee9f2aca6
Parents: 844e4b6
Author: Steve Loughran <st...@apache.org>
Authored: Wed Nov 5 20:34:13 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Wed Nov 5 20:34:13 2014 +0000

----------------------------------------------------------------------
 .../org/apache/slider/client/SliderClient.java  | 68 ++++++++++++++------
 .../common/params/ActionRegistryArgs.java       |  3 +-
 2 files changed, 52 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/70c1b1a7/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
index d9100e4..fcc6ef6 100644
--- a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
+++ b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
@@ -153,7 +153,9 @@ import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.PrintStream;
 import java.io.StringWriter;
 import java.io.Writer;
 import java.net.InetSocketAddress;
@@ -3000,16 +3002,28 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
     RegistryRetriever retriever = new RegistryRetriever(instance);
     PublishedConfigSet configurations =
         retriever.getConfigurations(!registryArgs.internal);
-
-    for (String configName : configurations.keys()) {
-      if (!registryArgs.verbose) {
-        log.info("{}", configName);
+    PrintStream out = null;
+    try {
+      if (registryArgs.out != null) {
+        out = new PrintStream(new FileOutputStream(registryArgs.out));
       } else {
-        PublishedConfiguration published =
-            configurations.get(configName);
-        log.info("{} : {}",
-            configName,
-            published.description);
+        out = System.out;
+      }
+      for (String configName : configurations.keys()) {
+        if (!registryArgs.verbose) {
+          out.println(configName);
+        } else {
+          PublishedConfiguration published =
+              configurations.get(configName);
+          out.printf("%s: %s\n",
+              configName,
+              published.description);
+        }
+      }
+    } finally {
+      if (registryArgs.out != null && out != null) {
+        out.flush();
+        out.close();
       }
     }
   }
@@ -3028,16 +3042,34 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
     RegistryRetriever retriever = new RegistryRetriever(instance);
     PublishedExportsSet exports =
         retriever.getExports(!registryArgs.internal);
-
-    for (String exportName : exports.keys()) {
-      if (!registryArgs.verbose) {
-        log.info("{}", exportName);
+    PrintStream out = null;
+    boolean streaming = false;
+    try {
+      if (registryArgs.out != null) {
+        out = new PrintStream(new FileOutputStream(registryArgs.out));
+        streaming = true;
+        log.debug("Saving output to {}", registryArgs.out);
       } else {
-        PublishedExports published =
-            exports.get(exportName);
-        log.info("{} : {}",
-                 exportName,
-                 published.description);
+        out = System.out;
+      }
+      log.debug("Number of exports: {}", exports.keys().size());
+      for (String exportName : exports.keys()) {
+        if (streaming) {
+          log.debug(exportName);
+        }
+        if (!registryArgs.verbose) {
+          out.println(exportName);
+        } else {
+          PublishedExports published = exports.get(exportName);
+          out.printf("%s: %s\n",
+              exportName,
+              published.description);
+        }
+      }
+    } finally {
+      if (streaming) {
+        out.flush();
+        out.close();
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/70c1b1a7/slider-core/src/main/java/org/apache/slider/common/params/ActionRegistryArgs.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/params/ActionRegistryArgs.java b/slider-core/src/main/java/org/apache/slider/common/params/ActionRegistryArgs.java
index 4b4c30a..da1b0e5 100644
--- a/slider-core/src/main/java/org/apache/slider/common/params/ActionRegistryArgs.java
+++ b/slider-core/src/main/java/org/apache/slider/common/params/ActionRegistryArgs.java
@@ -97,6 +97,7 @@ public class ActionRegistryArgs extends AbstractActionArgs {
   @Parameter(names = {ARG_LISTEXP},
              description = "list exports")
   public boolean listExports;
+
   @Parameter(names = {ARG_GETEXP},
              description = "get export")
   public String getExport;
@@ -154,7 +155,7 @@ public class ActionRegistryArgs extends AbstractActionArgs {
       throw new UsageException(USAGE);
     }
 
-    if (out != null && (lists > 0 || set == 0)) {
+    if (out != null && ( set == 0)) {
       throw new UsageException("output path"
            + " is only supported on 'get' operations: ");
     }


[4/5] git commit: SLIDER-616 AMFailuresIT

Posted by st...@apache.org.
SLIDER-616 AMFailuresIT


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/8943a14f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/8943a14f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/8943a14f

Branch: refs/heads/feature/SLIDER-616_re-enable_AMFailuresIT
Commit: 8943a14f0a1c45f5a83b0b3ccb9cc29bbe2a7cf8
Parents: 70c1b1a
Author: Steve Loughran <st...@apache.org>
Authored: Wed Nov 5 15:37:55 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Wed Nov 5 20:35:02 2014 +0000

----------------------------------------------------------------------
 slider-funtest/pom.xml                          |  4 +-
 .../framework/AgentCommandTestBase.groovy       |  3 +-
 .../funtest/framework/CommandTestBase.groovy    | 90 +++++++++++++++++---
 .../funtest/lifecycle/AMFailuresIT.groovy       | 37 +++-----
 4 files changed, 96 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8943a14f/slider-funtest/pom.xml
----------------------------------------------------------------------
diff --git a/slider-funtest/pom.xml b/slider-funtest/pom.xml
index 715fb23..81d6bf0 100644
--- a/slider-funtest/pom.xml
+++ b/slider-funtest/pom.xml
@@ -122,7 +122,7 @@
             <test.app.pkg.name>CMD_LOGGER</test.app.pkg.name>
             <test.app.resource>../slider-core/src/test/app_packages/test_command_log/resources.json</test.app.resource>
             <test.app.template>../slider-core/src/test/app_packages/test_command_log/appConfig.json</test.app.template>
-            <vagrant.current.working.dir>/Users/gsaha/work/workspace/ambari-vagrant/centos6.4</vagrant.current.working.dir>
+            <vagrant.current.working.dir></vagrant.current.working.dir>
           </systemPropertyVariables>
         </configuration>
       </plugin>
@@ -172,8 +172,6 @@
   <reporting>
     <plugins>
  
-
-
     </plugins>
   </reporting>
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8943a14f/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
index 6e05056..668a264 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
@@ -67,7 +67,8 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
     AGENTTESTS_LABELS_RED_BLUE_DEFINED =
         SLIDER_CONFIG.getBoolean(KEY_AGENTTESTS_LABELS_RED_BLUE_DEFINED, false)
     AGENTTESTS_AM_FAILURES_ENABLED = 
-        SLIDER_CONFIG.getBoolean(KEY_AGENTTESTS_AM_FAILURES_ENABLED, false)
+        SLIDER_CONFIG.getBoolean(KEY_AGENTTESTS_AM_FAILURES_ENABLED,
+            AGENTTESTS_ENABLED)
   }
 
   protected String getAppResource() {

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8943a14f/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
index 36515c5..7d369d5 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
@@ -775,12 +775,19 @@ abstract class CommandTestBase extends SliderTestUtils {
     ensureApplicationIsUp(cluster)
     return sliderClient.clusterDescription
   }
-  public ClusterDescription killAmAndWaitForRestart(
-      SliderClient sliderClient, String cluster, String appId) {
 
-    assert cluster
+  /**
+   * Kill an AM and await restrt
+   * @param sliderClient
+   * @param application
+   * @param appId
+   * @return
+   */
+  public void killAmAndWaitForRestart(String application, String appId) {
+
+    assert application
     slider(0, [
-        ACTION_AM_SUICIDE, cluster,
+        ACTION_AM_SUICIDE, application,
         ARG_EXITCODE, "1",
         ARG_WAIT, "1000",
         ARG_MESSAGE, "suicide"
@@ -788,9 +795,12 @@ abstract class CommandTestBase extends SliderTestUtils {
 
     sleep(5000)
     ensureYarnApplicationIsUp(appId)
-    return sliderClient.clusterDescription
   }
 
+  /**
+   * Spinning operation to perform a registry call
+   * @param application application
+   */
   protected void ensureRegistryCallSucceeds(String application) {
     repeatUntilSuccess(this.&isRegistryAccessible,
         REGISTRY_STARTUP_TIMEOUT,
@@ -808,7 +818,10 @@ abstract class CommandTestBase extends SliderTestUtils {
     }
   }
 
-   
+  /**
+   * wait for an application to come up
+   * @param application
+   */
   protected void ensureApplicationIsUp(String application) {
     repeatUntilSuccess(this.&isApplicationRunning,
         SLIDER_CONFIG.getInt(KEY_TEST_INSTANCE_LAUNCH_TIME,
@@ -822,6 +835,11 @@ abstract class CommandTestBase extends SliderTestUtils {
     }
   }
 
+  /**
+   * Is the registry accessible for an application?
+   * @param args argument map containing <code>"application"</code>
+   * @return probe outcome
+   */
   protected Outcome isRegistryAccessible(Map<String, String> args) {
     String applicationName = args['application'];
     SliderShell shell = slider(
@@ -837,11 +855,21 @@ abstract class CommandTestBase extends SliderTestUtils {
     return Outcome.fromBool(EXIT_SUCCESS == shell.execute())
   }
 
+  /**
+   * Probe for an application running; uses <code>exists</code> operation
+   * @param args argument map containing <code>"application"</code>
+   * @return
+   */
   protected Outcome isApplicationRunning(Map<String, String> args) {
     String applicationName = args['application'];
     return Outcome.fromBool(isApplicationUp(applicationName))
   }
 
+  /**
+   * Use <code>exists</code> operation to probe for an application being up
+   * @param applicationName app name
+   * @return true if it s running
+   */
   protected boolean isApplicationUp(String applicationName) {
     return isApplicationInState(
         applicationName,
@@ -850,7 +878,8 @@ abstract class CommandTestBase extends SliderTestUtils {
   }
 
   /**
-   * is an application in a desired yarn state 
+   * is an application in a desired yarn state. Uses the <code>exists</code>
+   * CLI operation
    * @param yarnState
    * @param applicationName
    * @return
@@ -863,6 +892,11 @@ abstract class CommandTestBase extends SliderTestUtils {
     return shell.ret == 0
   }
 
+  /**
+   * Probe callback for is the the app running or not
+   * @param args map where 'applicationId' must m
+   * @return
+   */
 
   protected Outcome isYarnApplicationRunning(Map<String, String> args) {
     String applicationId = args['applicationId'];
@@ -878,12 +912,25 @@ abstract class CommandTestBase extends SliderTestUtils {
    */
   public static Outcome isYarnApplicationRunning(
       String applicationId) {
-    YarnApplicationState appState = lookupYarnAppState(applicationId)
     YarnApplicationState yarnState = YarnApplicationState.RUNNING
+    return isYarnApplicationInState(applicationId, yarnState)
+  }
+
+  /**
+   * Probe for a YARN application being in a given state
+   * @param applicationId app id
+   * @param yarnStat desired state
+   * @return success for a match, retry if state below desired, and fail if
+   * above it
+   */
+  public static Outcome isYarnApplicationInState(
+      String applicationId,
+      YarnApplicationState yarnState) {
+    YarnApplicationState appState = lookupYarnAppState(applicationId)
     if (yarnState == appState) {
       return Outcome.Success;
     }
-    
+
     if (appState.ordinal() > yarnState.ordinal()) {
       // app has passed beyond hope
       return Outcome.Fail
@@ -891,6 +938,11 @@ abstract class CommandTestBase extends SliderTestUtils {
     return Outcome.Retry
   }
 
+  /**
+   * Look up the YARN application by ID, get its application record
+   * @param applicationId the application ID
+   * @return the application state
+   */
   public static YarnApplicationState lookupYarnAppState(String applicationId) {
     def sar = lookupApplication(applicationId)
     assert sar != null;
@@ -898,6 +950,11 @@ abstract class CommandTestBase extends SliderTestUtils {
     return appState
   }
 
+  /**
+   * Assert an application is in a given state; fail if not
+   * @param applicationId appId
+   * @param expectedState expected state
+   */
   public static void assertInYarnState(String applicationId,
       YarnApplicationState expectedState) {
     def applicationReport = lookupApplication(applicationId)
@@ -914,14 +971,14 @@ abstract class CommandTestBase extends SliderTestUtils {
     ensureYarnApplicationIsUp(id)
     return id;
   }
+ 
   /**
    * Wait for the YARN app to come up. This will fail fast
    * @param applicationId
    */
   protected void ensureYarnApplicationIsUp(String applicationId) {
     repeatUntilSuccess(this.&isYarnApplicationRunning,
-        SLIDER_CONFIG.getInt(KEY_TEST_INSTANCE_LAUNCH_TIME,
-            DEFAULT_INSTANCE_LAUNCH_TIME_SECONDS),
+        instanceLaunchTime,
         PROBE_SLEEP_TIME,
         [applicationId: applicationId],
         true,
@@ -935,6 +992,17 @@ abstract class CommandTestBase extends SliderTestUtils {
     }
   }
 
+  /**
+   * Get the expected launch time. Default is the configuration option
+   * {@link FuntestProperties#KEY_TEST_INSTANCE_LAUNCH_TIME} and
+   * default value {@link FuntestProperties#KEY_TEST_INSTANCE_LAUNCH_TIME}
+   * @return
+   */
+  public int getInstanceLaunchTime() {
+    return SLIDER_CONFIG.getInt(KEY_TEST_INSTANCE_LAUNCH_TIME,
+        DEFAULT_INSTANCE_LAUNCH_TIME_SECONDS)
+  }
+
   public String getInfoAmWebUrl(String applicationName) {
     ClusterDescription cd = execStatus(applicationName);
     String urlString = cd.getInfo("info.am.web.url");

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8943a14f/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
index a78ae87..6238164 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
@@ -72,9 +72,6 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
     def appId = ensureYarnApplicationIsUp(launchReportFile)
     expectContainerRequestedCountReached(APPLICATION_NAME, COMMAND_LOGGER, 1,
         CONTAINER_LAUNCH_TIMEOUT)
-    
-    // Wait for 20 secs for AM and agent to both reach STARTED state
-    sleep(1000 * 20)
 
     def cd = assertContainersLive(APPLICATION_NAME, COMMAND_LOGGER, 1)
     def loggerInstances = cd.instances[COMMAND_LOGGER]
@@ -82,37 +79,32 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
     def loggerStats = cd.statistics[COMMAND_LOGGER]
 
-    def origRequested = loggerStats["containers.requested"]
-    assert origRequested >= 2
+    assert loggerStats["containers.requested"] == 1
     assert loggerStats["containers.live"] == 1
 
-    assert isApplicationUp(APPLICATION_NAME), 'App is not running.'
-    assertSuccess(shell)
-
     // Now kill the AM
     log.info("Killing AM now ...")
 //    killAMUsingJsch()
-//    killAMUsingAmSuicide()
-    killAMUsingVagrantShell()
-
-    // Check that the application is not running (and is in ACCEPTED state)
-    assert lookupYarnAppState(appId) == YarnApplicationState.ACCEPTED ,
-      'App should be in ACCEPTED state (since AM got killed)'
-    log.info("After AM KILL: application {} is in ACCEPTED state", APPLICATION_NAME)
-
-    // Wait until AM comes back up and verify container count again
-    ensureYarnApplicationIsUp(appId)
+    killAmAndWaitForRestart(APPLICATION_NAME, appId)
 
     // There should be exactly 1 live logger container
     def cd2 = assertContainersLive(APPLICATION_NAME, COMMAND_LOGGER, 1)
 
     // No new containers should be requested for the agents
     def loggerStats2 = cd2.statistics[COMMAND_LOGGER]
-    assert origRequested == loggerStats2["containers.requested"],
+    assert loggerStats["containers.requested"] == loggerStats2["containers.requested"],
         'No new agent containers should be requested'
     assert lookupYarnAppState(appId) == YarnApplicationState.RUNNING 
   }
 
+  /**
+   * Allow for 2x as long as other test instances, as for AM restart we
+   * need to allow for a longer delay
+   */
+  @Override
+  int getInstanceLaunchTime() {
+    return 2* super.instanceLaunchTime
+  }
 
   protected void killAMUsingAmSuicide() {
     SliderShell shell = slider(EXIT_SUCCESS,
@@ -121,12 +113,11 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
           ARG_MESSAGE, "testAMRestart",
           APPLICATION_NAME])
     logShell(shell)
-    assertSuccess(shell)
   }
 
   protected void killAMUsingVagrantShell() {
     String hostname = SLIDER_CONFIG.get(YarnConfiguration.RM_ADDRESS).split(":")[0]
-    assert hostname != null && !hostname.isEmpty()
+    assert hostname
     String vagrantVmName = hostname.split("\\.")[0]
 
     String vagrantCwd = sysprop(VAGRANT_CWD)
@@ -146,8 +137,8 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
   protected void killAMUsingJsch() {
     String hostname = SLIDER_CONFIG.get(YarnConfiguration.RM_ADDRESS).split(":")[0]
     String user = UserGroupInformation.currentUser
-    assert hostname != null && !hostname.isEmpty()
-    assert user != null && !user.isEmpty()
+    assert hostname
+    assert user
 
     bindSSHKey()
     RemoteServer remoteServer = new RemoteServer(


[2/5] git commit: SLIDER-544 fix up dependencies before releasing

Posted by st...@apache.org.
SLIDER-544 fix up dependencies before releasing


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/844e4b67
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/844e4b67
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/844e4b67

Branch: refs/heads/feature/SLIDER-616_re-enable_AMFailuresIT
Commit: 844e4b6776c627f5eddeb22b233eff0da9cea55b
Parents: 66b1aa4
Author: Steve Loughran <st...@apache.org>
Authored: Wed Nov 5 20:29:18 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Wed Nov 5 20:29:18 2014 +0000

----------------------------------------------------------------------
 pom.xml | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/844e4b67/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f77a508..5a22cc4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -179,7 +179,7 @@
 
     <slf4j.version>1.7.5</slf4j.version>
     <stringtemplate.version>2.4.1</stringtemplate.version>
-    <zookeeper.version>3.4.5</zookeeper.version>
+    <zookeeper.version>3.4.6</zookeeper.version>
 
 
     <!--  Plugin versions    -->
@@ -943,6 +943,18 @@
             <groupId>org.junit</groupId>
             <artifactId>junit</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>com.sun.jdmk</groupId>
+            <artifactId>jmxtools</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>com.sun.jmx</groupId>
+            <artifactId>jmxri</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.jboss.netty</groupId>
+            <artifactId>netty</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
 
@@ -1228,6 +1240,13 @@
         <groupId>org.mortbay.jetty</groupId>
         <artifactId>jetty</artifactId>
         <version>${jetty.version}</version>
+        <exclusions>
+          <!-- cut the jetty version of the servlet API —Hadoop ships with one-->
+          <exclusion>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>servlet-api</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.mortbay.jetty</groupId>