Skip to content

Commit

Permalink
Fix for SparkContext stop behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
rekhajoshm committed Jun 26, 2015
1 parent 12f66b5 commit 1aff39c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/test/scala/org/apache/spark/SparkContextSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import org.apache.spark.util.Utils

import scala.concurrent.Await
import scala.concurrent.duration.Duration
import org.scalatest.Matchers._

class SparkContextSuite extends SparkFunSuite with LocalSparkContext {

Expand Down Expand Up @@ -274,16 +275,13 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext {
}

test("calling multiple sc.stop() must not throw any exception") {
try {
noException should be thrownBy {
sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local"))
val cnt = sc.parallelize(1 to 4).count()
sc.cancelAllJobs()
sc.stop()
// call stop second time
sc.stop()
} catch {
case e: Exception =>
fail("calling multiple sc.stop() must not throw any exception", e);
}
}
}

0 comments on commit 1aff39c

Please sign in to comment.