aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
authorNiranjan Padmanabhan <niranjan.padmanabhan@cloudera.com>2015-08-12 16:10:21 -0700
committerMarcelo Vanzin <vanzin@cloudera.com>2015-08-12 16:10:21 -0700
commit738f353988dbf02704bd63f5e35d94402c59ed79 (patch)
tree1ef4619abe50dd2ebe51218afddeaa7051312cf9 /core/src/test
parenta17384fa343628cec44437da5b80b9403ecd5838 (diff)
downloadspark-738f353988dbf02704bd63f5e35d94402c59ed79.tar.gz
spark-738f353988dbf02704bd63f5e35d94402c59ed79.tar.bz2
spark-738f353988dbf02704bd63f5e35d94402c59ed79.zip
[SPARK-9092] Fixed incompatibility when both num-executors and dynamic...
… allocation are set. Now, dynamic allocation is set to false when num-executors is explicitly specified as an argument. Consequently, executorAllocationManager in not initialized in the SparkContext. Author: Niranjan Padmanabhan <niranjan.padmanabhan@cloudera.com> Closes #7657 from neurons/SPARK-9092.
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/scala/org/apache/spark/SparkContextSuite.scala8
-rw-r--r--core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala1
2 files changed, 8 insertions, 1 deletions
diff --git a/core/src/test/scala/org/apache/spark/SparkContextSuite.scala b/core/src/test/scala/org/apache/spark/SparkContextSuite.scala
index 5c57940fa5..d4f2ea8765 100644
--- a/core/src/test/scala/org/apache/spark/SparkContextSuite.scala
+++ b/core/src/test/scala/org/apache/spark/SparkContextSuite.scala
@@ -285,4 +285,12 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext {
}
}
+ test("No exception when both num-executors and dynamic allocation set.") {
+ noException should be thrownBy {
+ sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local")
+ .set("spark.dynamicAllocation.enabled", "true").set("spark.executor.instances", "6"))
+ assert(sc.executorAllocationManager.isEmpty)
+ assert(sc.getConf.getInt("spark.executor.instances", 0) === 6)
+ }
+ }
}
diff --git a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
index 757e0ce3d2..2456c5d0d4 100644
--- a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
+++ b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
@@ -159,7 +159,6 @@ class SparkSubmitSuite
childArgsStr should include ("--executor-cores 5")
childArgsStr should include ("--arg arg1 --arg arg2")
childArgsStr should include ("--queue thequeue")
- childArgsStr should include ("--num-executors 6")
childArgsStr should include regex ("--jar .*thejar.jar")
childArgsStr should include regex ("--addJars .*one.jar,.*two.jar,.*three.jar")
childArgsStr should include regex ("--files .*file1.txt,.*file2.txt")