aboutsummaryrefslogtreecommitdiff
path: root/launcher/src/test
diff options
context:
space:
mode:
authorDevaraj K <devaraj@apache.org>2016-06-03 13:03:28 -0700
committerMarcelo Vanzin <vanzin@cloudera.com>2016-06-03 13:03:28 -0700
commitefd3b11a47ec553f68ab6aa714167f3aee2ecf56 (patch)
tree76b12d3b293bd2156f0f1990c6fe90c505065396 /launcher/src/test
parent9e2eb13ca59fc7ac66c6accd49469f339700b23b (diff)
downloadspark-efd3b11a47ec553f68ab6aa714167f3aee2ecf56.tar.gz
spark-efd3b11a47ec553f68ab6aa714167f3aee2ecf56.tar.bz2
spark-efd3b11a47ec553f68ab6aa714167f3aee2ecf56.zip
[SPARK-15665][CORE] spark-submit --kill and --status are not working
## What changes were proposed in this pull request? --kill and --status were not considered while handling in OptionParser and due to that it was failing. Now handling the --kill and --status options as part of OptionParser.handle. ## How was this patch tested? Added a test org.apache.spark.launcher.SparkSubmitCommandBuilderSuite.testCliKillAndStatus() and also I have verified these manually by running --kill and --status commands. Author: Devaraj K <devaraj@apache.org> Closes #13407 from devaraj-kavali/SPARK-15665.
Diffstat (limited to 'launcher/src/test')
-rw-r--r--launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java b/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java
index d451651555..16e5a22401 100644
--- a/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java
+++ b/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java
@@ -73,6 +73,12 @@ public class SparkSubmitCommandBuilderSuite extends BaseSuite {
}
@Test
+ public void testCliKillAndStatus() throws Exception {
+ testCLIOpts(parser.STATUS);
+ testCLIOpts(parser.KILL_SUBMISSION);
+ }
+
+ @Test
public void testCliParser() throws Exception {
List<String> sparkSubmitArgs = Arrays.asList(
parser.MASTER,
@@ -326,4 +332,12 @@ public class SparkSubmitCommandBuilderSuite extends BaseSuite {
return newCommandBuilder(args).buildCommand(env);
}
+ private void testCLIOpts(String opt) throws Exception {
+ List<String> helpArgs = Arrays.asList(opt, "driver-20160531171222-0000");
+ Map<String, String> env = new HashMap<>();
+ List<String> cmd = buildCommand(helpArgs, env);
+ assertTrue(opt + " should be contained in the final cmd.",
+ cmd.contains(opt));
+ }
+
}