Github user tgravescs commented on a diff in the pull request: https://github.com/apache/spark/pull/15009#discussion_r106049395 --- Diff: resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala --- @@ -252,20 +307,55 @@ class YarnClusterSuite extends BaseYarnClusterSuite { handle.getAppId() should startWith ("application_") handle.disconnect() + var applicationId = ConverterUtils.toApplicationId(handle.getAppId) + var yarnClient: YarnClient = getYarnClient eventually(timeout(30 seconds), interval(100 millis)) { handle.getState() should be (SparkAppHandle.State.LOST) + var status = yarnClient.getApplicationReport(applicationId).getFinalApplicationStatus + status should be (FinalApplicationStatus.KILLED) } + } finally { handle.kill() } } - test("timeout to get SparkContext in cluster mode triggers failure") { - val timeout = 2000 - val finalState = runSpark(false, mainClassName(SparkContextTimeoutApp.getClass), - appArgs = Seq((timeout * 4).toString), - extraConf = Map(AM_MAX_WAIT_TIME.key -> timeout.toString)) - finalState should be (SparkAppHandle.State.FAILED) + test("monitor app using launcher library for thread without auto shutdown") { + val env = new JHashMap[String, String]() + env.put("YARN_CONF_DIR", hadoopConfDir.getAbsolutePath()) + + val propsFile = createConfFile() + val handle = new SparkLauncher(env) + .setSparkHome(sys.props("spark.test.home")) + .setConf("spark.ui.enabled", "false") + .setPropertiesFile(propsFile) + .setMaster("yarn") + .setDeployMode("cluster") + .launchAsThread(true) + .setAppResource(SparkLauncher.NO_RESOURCE) + .setMainClass(mainClassName(YarnLauncherTestApp.getClass)) + .startApplication() + + try { + eventually(timeout(30 seconds), interval(100 millis)) { + handle.getState() should be (SparkAppHandle.State.RUNNING) + } + + handle.getAppId() should not be (null) + handle.getAppId() should startWith ("application_") + handle.disconnect() + + var applicationId = ConverterUtils.toApplicationId(handle.getAppId) + var yarnClient: YarnClient = getYarnClient + eventually(timeout(30 seconds), interval(100 millis)) { + handle.getState() should be (SparkAppHandle.State.LOST) + var status = yarnClient.getApplicationReport(applicationId).getYarnApplicationState + status should not be (YarnApplicationState.KILLED) --- End diff -- thi sis without auto shutdown so why is this killed ,it should still be running.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org