aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
authorwitgo <witgo@qq.com>2014-06-24 19:44:37 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-06-24 19:45:03 -0700
commitb6b44853cd61660f2917b99d87c157e2b4430e5c (patch)
tree70c29d704860634658a576cb736ada7f33c21ce9 /core/src/test
parent2714968e1b40221739c5dfba7ca4c0c06953dbe2 (diff)
downloadspark-b6b44853cd61660f2917b99d87c157e2b4430e5c.tar.gz
spark-b6b44853cd61660f2917b99d87c157e2b4430e5c.tar.bz2
spark-b6b44853cd61660f2917b99d87c157e2b4430e5c.zip
SPARK-2248: spark.default.parallelism does not apply in local mode
Author: witgo <witgo@qq.com> Closes #1194 from witgo/SPARK-2248 and squashes the following commits: 6ac950b [witgo] spark.default.parallelism does not apply in local mode
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala b/core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala
index 94fba10286..67e3be21c3 100644
--- a/core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala
+++ b/core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala
@@ -77,6 +77,22 @@ class SparkContextSchedulerCreationSuite
}
}
+ test("local-default-parallelism") {
+ val defaultParallelism = System.getProperty("spark.default.parallelism")
+ System.setProperty("spark.default.parallelism", "16")
+ val sched = createTaskScheduler("local")
+
+ sched.backend match {
+ case s: LocalBackend => assert(s.defaultParallelism() === 16)
+ case _ => fail()
+ }
+
+ Option(defaultParallelism) match {
+ case Some(v) => System.setProperty("spark.default.parallelism", v)
+ case _ => System.clearProperty("spark.default.parallelism")
+ }
+ }
+
test("simr") {
createTaskScheduler("simr://uri").backend match {
case s: SimrSchedulerBackend => // OK