SLIDER-646 intermittent AgentLaunchFailureIT test failures
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 210e257..1cb245a 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
@@ -615,10 +615,15 @@
   }
 
   /**
-   * Create a templated slider app
+   * Create a templated slider app.
+   * <p>
+   * If the extraArgs list does not contain a --wait parm then a wait 
+   * duration of THAW_WAIT_TIME will be added to the launch args.
    * @param name name
    * @param appTemplate application template
    * @param resourceTemplate resource template
+   * @param extraArgs list of extra arguments to the command
+   * @param launchReportFile optional file to save the AM launch report to
    * @return the shell
    */
   public SliderShell createTemplatedSliderApplication(
@@ -638,9 +643,12 @@
         ACTION_CREATE, name,
         ARG_TEMPLATE, appTemplate,
         ARG_RESOURCES, resourceTemplate,
-        ARG_OUTPUT, launchReportFile.absolutePath,
-        ARG_WAIT, Integer.toString(THAW_WAIT_TIME)
+        ARG_OUTPUT, launchReportFile.absolutePath
     ]
+    
+    if (!extraArgs.contains(ARG_WAIT)) {
+      commands << ARG_WAIT << Integer.toString(THAW_WAIT_TIME)
+    }
 
     maybeAddCommandOption(commands,
         [ARG_COMP_OPT, SliderKeys.COMPONENT_AM, SliderXmlConfKeys.KEY_AM_LOGIN_KEYTAB_NAME],
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 2e1ca0f..51a9010 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
@@ -20,6 +20,7 @@
 
 import groovy.transform.CompileStatic
 import groovy.util.logging.Slf4j
+import org.apache.slider.common.SliderXmlConfKeys
 import org.apache.slider.server.appmaster.SliderAppMaster
 
 import static org.apache.slider.api.InternalKeys.*
@@ -69,6 +70,8 @@
             ARG_OPTION, CHAOS_MONKEY_INTERVAL_SECONDS, "60",
             ARG_OPTION, CHAOS_MONKEY_PROBABILITY_AM_LAUNCH_FAILURE, 
              Integer.toString(PROBABILITY_PERCENT_100),
+            ARG_DEFINE, SliderXmlConfKeys.KEY_AM_RESTART_LIMIT + "=1",
+            ARG_WAIT, "0"
         ],
         launchReportFile)
 
@@ -93,6 +96,5 @@
     def sar = lookupApplication(appId)
     log.info(sar.toString())
     assert sar.diagnostics.contains(SliderAppMaster.E_TRIGGERED_LAUNCH_FAILURE)
-
   }
 }